about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-02-17 01:56:40 +0000
committerbors <bors@rust-lang.org>2022-02-17 01:56:40 +0000
commit930fc4f59ddeb9f26d554a2c75c5355989189540 (patch)
treea212ea519f1f3413970bd8c1eb86b97c69643771 /src/test
parent2ff7ea4de291b437912c5082b6c92fefe7d6457f (diff)
parentfc01d2b85424435ef9c6a65b68da17c3e17e8733 (diff)
downloadrust-930fc4f59ddeb9f26d554a2c75c5355989189540.tar.gz
rust-930fc4f59ddeb9f26d554a2c75c5355989189540.zip
Auto merge of #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 https://github.com/rust-lang/rust/issues/32976

r? `@Amanieu`
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs14
-rw-r--r--src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr57
2 files changed, 71 insertions, 0 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs
new file mode 100644
index 00000000000..df9c51cb176
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs
@@ -0,0 +1,14 @@
+fn main() {
+    cfg!(target_has_atomic_load_store = "8");
+    //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
+    cfg!(target_has_atomic_load_store = "16");
+    //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
+    cfg!(target_has_atomic_load_store = "32");
+    //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
+    cfg!(target_has_atomic_load_store = "64");
+    //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
+    cfg!(target_has_atomic_load_store = "128");
+    //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
+    cfg!(target_has_atomic_load_store = "ptr");
+    //~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
+}
diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr
new file mode 100644
index 00000000000..b9e6830a9f0
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr
@@ -0,0 +1,57 @@
+error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
+  --> $DIR/feature-gate-cfg-target-has-atomic.rs:2:10
+   |
+LL |     cfg!(target_has_atomic_load_store = "8");
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
+   = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
+
+error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
+  --> $DIR/feature-gate-cfg-target-has-atomic.rs:4:10
+   |
+LL |     cfg!(target_has_atomic_load_store = "16");
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
+   = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
+
+error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
+  --> $DIR/feature-gate-cfg-target-has-atomic.rs:6:10
+   |
+LL |     cfg!(target_has_atomic_load_store = "32");
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
+   = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
+
+error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
+  --> $DIR/feature-gate-cfg-target-has-atomic.rs:8:10
+   |
+LL |     cfg!(target_has_atomic_load_store = "64");
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
+   = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
+
+error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
+  --> $DIR/feature-gate-cfg-target-has-atomic.rs:10:10
+   |
+LL |     cfg!(target_has_atomic_load_store = "128");
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
+   = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
+
+error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
+  --> $DIR/feature-gate-cfg-target-has-atomic.rs:12:10
+   |
+LL |     cfg!(target_has_atomic_load_store = "ptr");
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94039 <https://github.com/rust-lang/rust/issues/94039> for more information
+   = help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0658`.