Skip to content

Remove use of stable and nightly features #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ edition = "2018"

[dependencies]
bitflags = "1.1.0"
rustversion = "1.0.5"

[target.'cfg(target_arch = "x86_64")'.dependencies]
x86_64 = { version = "0.14.0", default-features = false, features = ["instructions"] }
x86_64 = { version = "0.14.9", default-features = false, features = ["instructions"] }

[features]
default = [ "nightly" ]
stable = [ "x86_64/external_asm" ]
nightly = [ "x86_64/inline_asm" ]
default = []
# TOOD: Remove these deprecated features on next breaking release
stable = []
nightly = []

[package.metadata.release]
dev-version = false
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ serial_port.send(42);
let data = serial_port.receive();
```

## Crate Feature Flags

* `nightly`: This is the default.
* `stable`: Use this to build with non-nightly rust. Needs `default-features = false`.

## Building with stable rust

This needs to have the [compile-time requirements](https://github.com/alexcrichton/cc-rs#compile-time-requirements) of the `cc` crate installed on your system.
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@
#![warn(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(not(any(feature = "stable", feature = "nightly")))]
compile_error!("Either the `stable` or `nightly` feature must be enabled");

use bitflags::bitflags;

macro_rules! wait_for {
Expand Down
15 changes: 1 addition & 14 deletions src/mmio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,7 @@ impl MmioSerialPort {
///
/// This function is unsafe because the caller must ensure that the given base address
/// really points to a serial port device.
#[cfg(feature = "nightly")]
pub const unsafe fn new(base: usize) -> Self {
let base_pointer = base as *mut u8;
Self {
data: AtomicPtr::new(base_pointer),
int_en: AtomicPtr::new(base_pointer.add(1)),
fifo_ctrl: AtomicPtr::new(base_pointer.add(2)),
line_ctrl: AtomicPtr::new(base_pointer.add(3)),
modem_ctrl: AtomicPtr::new(base_pointer.add(4)),
line_sts: AtomicPtr::new(base_pointer.add(5)),
}
}

#[cfg(feature = "stable")]
#[rustversion::attr(since(1.61), const)]
pub unsafe fn new(base: usize) -> Self {
let base_pointer = base as *mut u8;
Self {
Expand Down