Skip to content

Commit 930fc4f

Browse files
committed
Auto merge of rust-lang#94040 - Mark-Simulacrum:destabilize-load-store, r=Amanieu
Destabilize cfg(target_has_atomic_load_store = ...) This was not intended to be stabilized yet. This keeps the cfg_target_has_atomic feature gate name since compiler-builtins otherwise depends on it and I'd rather not try to manage a bump across a crates.io published repository given the time-sensitivity here (we need to land this quickly to avoid a beta backport). Closes rust-lang#32976 r? `@Amanieu`
2 parents 2ff7ea4 + fc01d2b commit 930fc4f

File tree

7 files changed

+76
-3
lines changed

7 files changed

+76
-3
lines changed

compiler/rustc_feature/src/accepted.rs

-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ declare_features! (
7272
(accepted, cfg_doctest, "1.40.0", Some(62210), None),
7373
/// Allows `cfg(target_feature = "...")`.
7474
(accepted, cfg_target_feature, "1.27.0", Some(29717), None),
75-
/// Allows `cfg(target_has_atomic = "...")`.
76-
(accepted, cfg_target_has_atomic, "1.60.0", Some(32976), None),
7775
/// Allows `cfg(target_vendor = "...")`.
7876
(accepted, cfg_target_vendor, "1.33.0", Some(29718), None),
7977
/// Allows implementing `Clone` for closures where possible (RFC 2132).

compiler/rustc_feature/src/active.rs

+2
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ declare_features! (
312312
(active, cfg_sanitize, "1.41.0", Some(39699), None),
313313
/// Allows `cfg(target_abi = "...")`.
314314
(active, cfg_target_abi, "1.55.0", Some(80970), None),
315+
/// Allows `cfg(target_has_atomic_load_store = "...")`.
316+
(active, cfg_target_has_atomic, "1.60.0", Some(94039), None),
315317
/// Allows `cfg(target_has_atomic_equal_alignment = "...")`.
316318
(active, cfg_target_has_atomic_equal_alignment, "1.60.0", Some(93822), None),
317319
/// Allows `cfg(target_thread_local)`.

compiler/rustc_feature/src/builtin_attrs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const GATED_CFGS: &[GatedCfg] = &[
3131
sym::cfg_target_has_atomic_equal_alignment,
3232
cfg_fn!(cfg_target_has_atomic_equal_alignment),
3333
),
34+
(sym::target_has_atomic_load_store, sym::cfg_target_has_atomic, cfg_fn!(cfg_target_has_atomic)),
3435
(sym::sanitize, sym::cfg_sanitize, cfg_fn!(cfg_sanitize)),
3536
(sym::version, sym::cfg_version, cfg_fn!(cfg_version)),
3637
(sym::panic, sym::cfg_panic, cfg_fn!(cfg_panic)),

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ symbols! {
423423
cfg_target_feature,
424424
cfg_target_has_atomic,
425425
cfg_target_has_atomic_equal_alignment,
426+
cfg_target_has_atomic_load_store,
426427
cfg_target_thread_local,
427428
cfg_target_vendor,
428429
cfg_version,

library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
#![feature(allow_internal_unstable)]
156156
#![feature(associated_type_bounds)]
157157
#![feature(auto_traits)]
158-
#![cfg_attr(bootstrap, feature(cfg_target_has_atomic))]
158+
#![feature(cfg_target_has_atomic)]
159159
#![cfg_attr(not(bootstrap), feature(cfg_target_has_atomic_equal_alignment))]
160160
#![feature(const_fn_floating_point_arithmetic)]
161161
#![feature(const_fn_fn_ptr_basics)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
fn main() {
2+
cfg!(target_has_atomic_load_store = "8");
3+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
4+
cfg!(target_has_atomic_load_store = "16");
5+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
6+
cfg!(target_has_atomic_load_store = "32");
7+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
8+
cfg!(target_has_atomic_load_store = "64");
9+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
10+
cfg!(target_has_atomic_load_store = "128");
11+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
12+
cfg!(target_has_atomic_load_store = "ptr");
13+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
2+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:2:10
3+
|
4+
LL | cfg!(target_has_atomic_load_store = "8");
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
8+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
9+
10+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
11+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:4:10
12+
|
13+
LL | cfg!(target_has_atomic_load_store = "16");
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
|
16+
= note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
17+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
18+
19+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
20+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:6:10
21+
|
22+
LL | cfg!(target_has_atomic_load_store = "32");
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
|
25+
= note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
26+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
27+
28+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
29+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:8:10
30+
|
31+
LL | cfg!(target_has_atomic_load_store = "64");
32+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
|
34+
= note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
35+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
36+
37+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
38+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:10:10
39+
|
40+
LL | cfg!(target_has_atomic_load_store = "128");
41+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42+
|
43+
= note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
44+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
45+
46+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
47+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:12:10
48+
|
49+
LL | cfg!(target_has_atomic_load_store = "ptr");
50+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51+
|
52+
= note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
53+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
54+
55+
error: aborting due to 6 previous errors
56+
57+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)