Skip to content

Commit 3c1e02a

Browse files
committed
Remove msrv_1_77 feature
Use `autocfg` to detect Rust >=1.77
1 parent ab6bfad commit 3c1e02a

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ default = ["std"]
2727
libm = ["dep:libm"]
2828
std = []
2929

30-
# Allows access to functionality only available in Rust 1.77, such as round_ties_even
31-
# This increases the MSRV to 1.77
32-
msrv_1_77 = []
33-
3430
# vestigial features, now always in effect
3531
i128 = []
3632

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ fn main() {
22
let ac = autocfg::new();
33

44
ac.emit_expression_cfg("1f64.total_cmp(&2f64)", "has_total_cmp"); // 1.62
5+
ac.emit_expression_cfg("1.5f64.round_ties_even()", "has_round_ties_even"); // 1.77
56

67
autocfg::rerun_path("build.rs");
78
}

src/float.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ impl FloatCore for f32 {
869869
Self::powi(self, n: i32) -> Self;
870870
}
871871

872-
#[cfg(all(feature = "std", feature = "msrv_1_77"))]
872+
#[cfg(all(feature = "std", has_round_ties_even))]
873873
forward! {
874874
Self::round_ties_even(self) -> Self;
875875
}
@@ -936,7 +936,7 @@ impl FloatCore for f64 {
936936
Self::powi(self, n: i32) -> Self;
937937
}
938938

939-
#[cfg(all(feature = "std", feature = "msrv_1_77"))]
939+
#[cfg(all(feature = "std", has_round_ties_even))]
940940
forward! {
941941
Self::round_ties_even(self) -> Self;
942942
}
@@ -2549,7 +2549,7 @@ mod tests {
25492549
/// Compares the fallback implementation of [`round_ties_even`] to the one provided by `f32`.`
25502550
///
25512551
/// [`round_ties_even`]: crate::float::FloatCore::round_ties_even
2552-
#[cfg(feature = "msrv_1_77")]
2552+
#[cfg(has_round_ties_even)]
25532553
#[test]
25542554
fn round_ties_even() {
25552555
mod wrapped_f32 {

0 commit comments

Comments
 (0)