Skip to content

Commit c8c936a

Browse files
authored
Merge pull request #24 from josephlr/night
Remove use of `stable` and `nightly` features
2 parents b40fdfe + 0e78b70 commit c8c936a

File tree

4 files changed

+7
-26
lines changed

4 files changed

+7
-26
lines changed

Cargo.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ edition = "2018"
99

1010
[dependencies]
1111
bitflags = "1.1.0"
12+
rustversion = "1.0.5"
1213

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

1617
[features]
17-
default = [ "nightly" ]
18-
stable = [ "x86_64/external_asm" ]
19-
nightly = [ "x86_64/inline_asm" ]
18+
default = []
19+
# TOOD: Remove these deprecated features on next breaking release
20+
stable = []
21+
nightly = []
2022

2123
[package.metadata.release]
2224
dev-version = false

README.md

-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ serial_port.send(42);
4747
let data = serial_port.receive();
4848
```
4949

50-
## Crate Feature Flags
51-
52-
* `nightly`: This is the default.
53-
* `stable`: Use this to build with non-nightly rust. Needs `default-features = false`.
54-
5550
## Building with stable rust
5651

5752
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.

src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@
6262
#![warn(missing_docs)]
6363
#![cfg_attr(docsrs, feature(doc_cfg))]
6464

65-
#[cfg(not(any(feature = "stable", feature = "nightly")))]
66-
compile_error!("Either the `stable` or `nightly` feature must be enabled");
67-
6865
use bitflags::bitflags;
6966

7067
macro_rules! wait_for {

src/mmio.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,7 @@ impl MmioSerialPort {
2020
///
2121
/// This function is unsafe because the caller must ensure that the given base address
2222
/// really points to a serial port device.
23-
#[cfg(feature = "nightly")]
24-
pub const unsafe fn new(base: usize) -> Self {
25-
let base_pointer = base as *mut u8;
26-
Self {
27-
data: AtomicPtr::new(base_pointer),
28-
int_en: AtomicPtr::new(base_pointer.add(1)),
29-
fifo_ctrl: AtomicPtr::new(base_pointer.add(2)),
30-
line_ctrl: AtomicPtr::new(base_pointer.add(3)),
31-
modem_ctrl: AtomicPtr::new(base_pointer.add(4)),
32-
line_sts: AtomicPtr::new(base_pointer.add(5)),
33-
}
34-
}
35-
36-
#[cfg(feature = "stable")]
23+
#[rustversion::attr(since(1.61), const)]
3724
pub unsafe fn new(base: usize) -> Self {
3825
let base_pointer = base as *mut u8;
3926
Self {

0 commit comments

Comments
 (0)