Skip to content

Commit 4f4dbe8

Browse files
committed
Rename the public-test-deps feature to unstable-public-internals
`compiler-builtins` uses `public-test-deps`, `libm` uses `unstable-public-internals`. Consolidate these under the `libm` name. Once compiler-builtins is no longer published, this feature can probably be dropped. Also switch to `dep:` syntax for features that enable dependencies.
1 parent 767597f commit 4f4dbe8

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

builtins-test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ iai-callgrind = { version = "0.14.0", optional = true }
1919
[dependencies.compiler_builtins]
2020
path = "../compiler-builtins"
2121
default-features = false
22-
features = ["public-test-deps"]
22+
features = ["unstable-public-internals"]
2323

2424
[dev-dependencies]
2525
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }

compiler-builtins/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ homepage = "https://github.com/rust-lang/compiler-builtins"
99
documentation = "https://docs.rs/compiler_builtins"
1010
edition = "2021"
1111
description = "Compiler intrinsics used by the Rust compiler."
12-
links = 'compiler-rt'
12+
links = "compiler-rt"
1313

1414
[lib]
1515
bench = false
@@ -19,20 +19,20 @@ test = false
1919
[dependencies]
2020
# For more information on this dependency see
2121
# https://github.com/rust-lang/rust/tree/master/library/rustc-std-workspace-core
22-
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }
22+
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
2323

2424
[build-dependencies]
2525
cc = { optional = true, version = "1.0" }
2626

2727
[dev-dependencies]
28-
panic-handler = { path = '../crates/panic-handler' }
28+
panic-handler = { path = "../crates/panic-handler" }
2929

3030
[features]
3131
default = ["compiler-builtins"]
3232

3333
# Enable compilation of C code in compiler-rt, filling in some more optimized
3434
# implementations and also filling in unimplemented intrinsics
35-
c = ["cc"]
35+
c = ["dep:cc"]
3636

3737
# Workaround for the Cranelift codegen backend. Disables any implementations
3838
# which use inline assembly and fall back to pure Rust versions (if avalible).
@@ -53,11 +53,11 @@ mem = []
5353
mangled-names = []
5454

5555
# Only used in the compiler's build system
56-
rustc-dep-of-std = ['compiler-builtins', 'core']
56+
rustc-dep-of-std = ["compiler-builtins", "dep:core"]
5757

5858
# This makes certain traits and function specializations public that
5959
# are not normally public but are required by the `builtins-test`
60-
public-test-deps = []
60+
unstable-public-internals = []
6161

6262
[lints.rust]
6363
# The cygwin config can be dropped after our benchmark toolchain is bumped

compiler-builtins/src/float/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub mod sub;
99
pub(crate) mod traits;
1010
pub mod trunc;
1111

12-
#[cfg(not(feature = "public-test-deps"))]
12+
#[cfg(not(feature = "unstable-public-internals"))]
1313
pub(crate) use traits::{Float, HalfRep};
14-
#[cfg(feature = "public-test-deps")]
14+
#[cfg(feature = "unstable-public-internals")]
1515
pub use traits::{Float, HalfRep};

compiler-builtins/src/int/leading_zeros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// adding a zero check at the beginning, but `__clzsi2` has a precondition that `x != 0`.
44
// Compilers will insert the check for zero in cases where it is needed.
55

6-
#[cfg(feature = "public-test-deps")]
6+
#[cfg(feature = "unstable-public-internals")]
77
pub use implementation::{leading_zeros_default, leading_zeros_riscv};
8-
#[cfg(not(feature = "public-test-deps"))]
8+
#[cfg(not(feature = "unstable-public-internals"))]
99
pub(crate) use implementation::{leading_zeros_default, leading_zeros_riscv};
1010

1111
mod implementation {

compiler-builtins/src/int/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mod traits;
1212
pub mod udiv;
1313

1414
pub use big::{i256, u256};
15-
#[cfg(not(feature = "public-test-deps"))]
15+
#[cfg(not(feature = "unstable-public-internals"))]
1616
pub(crate) use traits::{CastFrom, CastInto, DInt, HInt, Int, MinInt};
17-
#[cfg(feature = "public-test-deps")]
17+
#[cfg(feature = "unstable-public-internals")]
1818
pub use traits::{CastFrom, CastInto, DInt, HInt, Int, MinInt};

compiler-builtins/src/int/specialized_div_rem/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ mod delegate;
5656

5757
// used on SPARC
5858
#[allow(unused_imports)]
59-
#[cfg(not(feature = "public-test-deps"))]
59+
#[cfg(not(feature = "unstable-public-internals"))]
6060
pub(crate) use self::delegate::u128_divide_sparc;
61-
#[cfg(feature = "public-test-deps")]
61+
#[cfg(feature = "unstable-public-internals")]
6262
pub use self::delegate::u128_divide_sparc;
6363

6464
#[macro_use]

compiler-builtins/src/int/trailing_zeros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#[cfg(feature = "public-test-deps")]
1+
#[cfg(feature = "unstable-public-internals")]
22
pub use implementation::trailing_zeros;
3-
#[cfg(not(feature = "public-test-deps"))]
3+
#[cfg(not(feature = "unstable-public-internals"))]
44
pub(crate) use implementation::trailing_zeros;
55

66
mod implementation {

compiler-builtins/src/int/udiv.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#[cfg(not(feature = "public-test-deps"))]
1+
#[cfg(not(feature = "unstable-public-internals"))]
22
pub(crate) use crate::int::specialized_div_rem::*;
3-
#[cfg(feature = "public-test-deps")]
3+
#[cfg(feature = "unstable-public-internals")]
44
pub use crate::int::specialized_div_rem::*;
55

66
intrinsics! {

0 commit comments

Comments
 (0)