Skip to content

Commit 9fe5773

Browse files
committed
fixup/ci: feature-gate stabilized compiler features
Adds conditional feature-gates based on `rustc` version to only include unstable features on older compiler versions. Introduces the `rustversion` dependency to handle the feature-gates. Fixes breaking CI builds.
1 parent 545e84b commit 9fe5773

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ categories = ["no-std"]
1010

1111
[dependencies]
1212
memchr = { version = "2", default-features = false }
13+
rustversion = "1.0"
1314

1415
[features]
1516
default = ["std"]

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#![cfg_attr(feature = "nightly", feature(maybe_uninit_ref))]
21
#![cfg_attr(feature = "nightly", feature(never_type))]
3-
#![cfg_attr(all(feature = "std", feature = "nightly"), feature(read_initializer))]
42
#![cfg_attr(not(feature = "std"), no_std)]
53
#![cfg_attr(feature = "std", allow(dead_code))]
4+
#[rustversion::attr(all(before(1.55), feature = "nightly"), feature(maybe_uninit_ref))]
5+
#[rustversion::attr(all(before(1.55), feature = "std", feature = "nightly"), feature(read_initializer))]
66

77
#[cfg(not(feature = "std"))]
88
pub mod error;

0 commit comments

Comments
 (0)