Skip to content

Commit af56ad7

Browse files
committed
Add feature gate ui test for cfg(target_has_atomic_load_store).
1 parent 9e3f94d commit af56ad7

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ fn main() {
8787
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change
8888
cfg!(target_has_atomic = "ptr");
8989
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change
90+
cfg!(target_has_atomic_load_store = "8");
91+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
92+
cfg!(target_has_atomic_load_store = "16");
93+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
94+
cfg!(target_has_atomic_load_store = "32");
95+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
96+
cfg!(target_has_atomic_load_store = "64");
97+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
98+
cfg!(target_has_atomic_load_store = "128");
99+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
100+
cfg!(target_has_atomic_load_store = "ptr");
101+
//~^ ERROR `cfg(target_has_atomic_load_store)` is experimental and subject to change
90102
}
91103

92104
#[macro_export]

src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,60 @@ LL | cfg!(target_has_atomic = "ptr");
160160
= note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
161161
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
162162

163-
error: aborting due to 18 previous errors
163+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
164+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:90:10
165+
|
166+
LL | cfg!(target_has_atomic_load_store = "8");
167+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168+
|
169+
= note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
170+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
171+
172+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
173+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:92:10
174+
|
175+
LL | cfg!(target_has_atomic_load_store = "16");
176+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177+
|
178+
= note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
179+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
180+
181+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
182+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:94:10
183+
|
184+
LL | cfg!(target_has_atomic_load_store = "32");
185+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186+
|
187+
= note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
188+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
189+
190+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
191+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:96:10
192+
|
193+
LL | cfg!(target_has_atomic_load_store = "64");
194+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
195+
|
196+
= note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
197+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
198+
199+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
200+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:98:10
201+
|
202+
LL | cfg!(target_has_atomic_load_store = "128");
203+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
204+
|
205+
= note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
206+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
207+
208+
error[E0658]: `cfg(target_has_atomic_load_store)` is experimental and subject to change
209+
--> $DIR/feature-gate-cfg-target-has-atomic.rs:100:10
210+
|
211+
LL | cfg!(target_has_atomic_load_store = "ptr");
212+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
213+
|
214+
= note: see issue #32976 <https://github.com/rust-lang/rust/issues/32976> for more information
215+
= help: add `#![feature(cfg_target_has_atomic)]` to the crate attributes to enable
216+
217+
error: aborting due to 24 previous errors
164218

165219
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)