This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +16
-9
lines changed
crates/compiler-builtins-smoke-test Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ default = []
18
18
19
19
# This tells the compiler to assume that a Nightly toolchain is being used and
20
20
# that it should activate any useful Nightly things accordingly.
21
- unstable = []
21
+ unstable = [" unstable-intrinsics" ]
22
+
23
+ # Enable calls to functions in `core::intrinsics`
24
+ unstable-intrinsics = []
22
25
23
26
# Used to prevent using any intrinsics or arch-specific code.
24
27
force-soft-floats = []
Original file line number Diff line number Diff line change 49
49
if [ " ${BUILD_ONLY:- } " = " 1" ]; then
50
50
cmd=" cargo build --target $target --package libm"
51
51
$cmd
52
- $cmd --features ' unstable'
52
+ $cmd --features " unstable-intrinsics "
53
53
54
54
echo " can't run tests on $target "
55
55
else
60
60
$cmd --release
61
61
62
62
# unstable with a feature
63
- $cmd --features ' unstable'
64
- $cmd --release --features ' unstable'
63
+ $cmd --features " unstable-intrinsics "
64
+ $cmd --release --features " unstable-intrinsics "
65
65
fi
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ test = false
10
10
bench = false
11
11
12
12
[features ]
13
+ # Duplicated from libm's Cargo.toml
13
14
unstable = []
15
+ unstable-intrinsics = []
14
16
checked = []
15
17
force-soft-floats = []
Original file line number Diff line number Diff line change 1
1
//! libm in pure Rust
2
2
#![ no_std]
3
- #![ cfg_attr( feature = "unstable" , allow( internal_features) ) ]
4
- #![ cfg_attr( feature = "unstable" , feature( core_intrinsics) ) ]
3
+ #![ cfg_attr( feature = "unstable-intrinsics " , allow( internal_features) ) ]
4
+ #![ cfg_attr( feature = "unstable-intrinsics " , feature( core_intrinsics) ) ]
5
5
#![ allow( clippy:: assign_op_pattern) ]
6
6
#![ allow( clippy:: deprecated_cfg_attr) ]
7
7
#![ allow( clippy:: eq_op) ]
Original file line number Diff line number Diff line change @@ -60,14 +60,14 @@ macro_rules! i {
60
60
// the time of this writing this is only used in a few places, and once
61
61
// rust-lang/rust#72751 is fixed then this macro will no longer be necessary and
62
62
// the native `/` operator can be used and panics won't be codegen'd.
63
- #[ cfg( any( debug_assertions, not( feature = "unstable" ) ) ) ]
63
+ #[ cfg( any( debug_assertions, not( feature = "unstable-intrinsics " ) ) ) ]
64
64
macro_rules! div {
65
65
( $a: expr, $b: expr) => {
66
66
$a / $b
67
67
} ;
68
68
}
69
69
70
- #[ cfg( all( not( debug_assertions) , feature = "unstable" ) ) ]
70
+ #[ cfg( all( not( debug_assertions) , feature = "unstable-intrinsics " ) ) ]
71
71
macro_rules! div {
72
72
( $a: expr, $b: expr) => {
73
73
unsafe { core:: intrinsics:: unchecked_div( $a, $b) }
@@ -76,7 +76,9 @@ macro_rules! div {
76
76
77
77
macro_rules! llvm_intrinsically_optimized {
78
78
( #[ cfg( $( $clause: tt) * ) ] $e: expr) => {
79
- #[ cfg( all( feature = "unstable" , not( feature = "force-soft-floats" ) , $( $clause) * ) ) ]
79
+ #[ cfg( all(
80
+ feature = "unstable-intrinsics" , not( feature = "force-soft-floats" ) , $( $clause) *
81
+ ) ) ]
80
82
{
81
83
if true { // thwart the dead code lint
82
84
$e
You can’t perform that action at this time.
0 commit comments