diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 54a935d13c8c1..eaf8eddfff3a5 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -108,6 +108,8 @@ declare_features! ( (accepted, cfg_target_abi, "1.78.0", Some(80970)), /// Allows `cfg(target_feature = "...")`. (accepted, cfg_target_feature, "1.27.0", Some(29717)), + /// Allows `cfg(target_has_atomic_primitive_alignment = "...")`. + (accepted, cfg_target_has_atomic_equal_alignment, "CURRENT_RUSTC_VERSION", Some(93822)), /// Allows `cfg(target_vendor = "...")`. (accepted, cfg_target_vendor, "1.33.0", Some(29718)), /// Allows implementing `Clone` for closures where possible (RFC 2132). diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index 58bf12855ad6e..e10b9a77be851 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -20,11 +20,6 @@ const GATED_CFGS: &[GatedCfg] = &[ (sym::ub_checks, sym::cfg_ub_checks, Features::cfg_ub_checks), (sym::contract_checks, sym::cfg_contract_checks, Features::cfg_contract_checks), (sym::target_thread_local, sym::cfg_target_thread_local, Features::cfg_target_thread_local), - ( - sym::target_has_atomic_equal_alignment, - sym::cfg_target_has_atomic_equal_alignment, - Features::cfg_target_has_atomic_equal_alignment, - ), ( sym::target_has_atomic_load_store, sym::cfg_target_has_atomic, diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 0d44d3c0d4d79..11fcdaf163e74 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -442,8 +442,6 @@ declare_features! ( (unstable, cfg_target_compact, "1.63.0", Some(96901)), /// Allows `cfg(target_has_atomic_load_store = "...")`. (unstable, cfg_target_has_atomic, "1.60.0", Some(94039)), - /// Allows `cfg(target_has_atomic_equal_alignment = "...")`. - (unstable, cfg_target_has_atomic_equal_alignment, "1.60.0", Some(93822)), /// Allows `cfg(target_object_format = "...")`. (unstable, cfg_target_object_format, "CURRENT_RUSTC_VERSION", Some(152586)), /// Allows `cfg(target_thread_local)`. diff --git a/compiler/rustc_session/src/config/cfg.rs b/compiler/rustc_session/src/config/cfg.rs index 9c76f4f3db92f..d16ab59a02d9e 100644 --- a/compiler/rustc_session/src/config/cfg.rs +++ b/compiler/rustc_session/src/config/cfg.rs @@ -149,7 +149,7 @@ pub(crate) fn disallow_cfgs(sess: &Session, user_cfgs: &Cfg) { | (sym::target_pointer_width, Some(_)) | (sym::target_vendor, None | Some(_)) | (sym::target_has_atomic, Some(_)) - | (sym::target_has_atomic_equal_alignment, Some(_)) + | (sym::target_has_atomic_primitive_alignment, Some(_)) | (sym::target_has_atomic_load_store, Some(_)) | (sym::target_has_reliable_f16, None | Some(_)) | (sym::target_has_reliable_f16_math, None | Some(_)) @@ -293,7 +293,7 @@ pub(crate) fn default_configuration(sess: &Session) -> Cfg { ins_sym!(sym::target_has_atomic, sym); } if align.bits() == i { - ins_sym!(sym::target_has_atomic_equal_alignment, sym); + ins_sym!(sym::target_has_atomic_primitive_alignment, sym); } ins_sym!(sym::target_has_atomic_load_store, sym); }; @@ -485,13 +485,10 @@ impl CheckCfg { sym::integer(64usize), sym::integer(128usize), ]; - for sym in [ - sym::target_has_atomic, - sym::target_has_atomic_equal_alignment, - sym::target_has_atomic_load_store, - ] { + for sym in [sym::target_has_atomic, sym::target_has_atomic_load_store] { ins!(sym, no_values).extend(atomic_values); } + ins!(sym::target_has_atomic_primitive_alignment, empty_values).extend(atomic_values); ins!(sym::target_thread_local, no_values); diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 7f00cf203d827..b6703be8f4604 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -2021,8 +2021,8 @@ symbols! { target_feature_11, target_feature_inline_always, target_has_atomic, - target_has_atomic_equal_alignment, target_has_atomic_load_store, + target_has_atomic_primitive_alignment, target_has_reliable_f16, target_has_reliable_f16_math, target_has_reliable_f128, diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 57ce51bb8c0ed..3e18f87e20537 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -61,11 +61,11 @@ target_has_atomic = "32", target_has_atomic = "64", target_has_atomic = "ptr", - target_has_atomic_equal_alignment = "8", - target_has_atomic_equal_alignment = "16", - target_has_atomic_equal_alignment = "32", - target_has_atomic_equal_alignment = "64", - target_has_atomic_equal_alignment = "ptr", + target_has_atomic_primitive_alignment = "8", + target_has_atomic_primitive_alignment = "16", + target_has_atomic_primitive_alignment = "32", + target_has_atomic_primitive_alignment = "64", + target_has_atomic_primitive_alignment = "ptr", target_has_atomic_load_store = "8", target_has_atomic_load_store = "16", target_has_atomic_load_store = "32", @@ -123,7 +123,6 @@ #![feature(auto_traits)] #![feature(cfg_sanitize)] #![feature(cfg_target_has_atomic)] -#![feature(cfg_target_has_atomic_equal_alignment)] #![feature(cfg_ub_checks)] #![feature(const_closures)] #![feature(const_precise_live_drops)] diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs index 004772267da74..8a9a0b52ffec3 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs @@ -622,7 +622,7 @@ impl AtomicBool { /// assert_eq!(some_bool, false); /// ``` #[inline] - #[cfg(target_has_atomic_equal_alignment = "8")] + #[cfg(target_has_atomic_primitive_alignment = "8")] #[unstable(feature = "atomic_from_mut", issue = "76314")] pub fn from_mut(v: &mut bool) -> &mut Self { // SAFETY: the mutable reference guarantees unique ownership, and @@ -682,7 +682,7 @@ impl AtomicBool { /// assert_eq!(some_bools, [true; 10]); /// ``` #[inline] - #[cfg(target_has_atomic_equal_alignment = "8")] + #[cfg(target_has_atomic_primitive_alignment = "8")] #[unstable(feature = "atomic_from_mut", issue = "76314")] pub fn from_mut_slice(v: &mut [bool]) -> &mut [Self] { // SAFETY: the mutable reference guarantees unique ownership, and @@ -1593,7 +1593,7 @@ impl AtomicPtr { /// assert_eq!(unsafe { *some_ptr }, 456); /// ``` #[inline] - #[cfg(target_has_atomic_equal_alignment = "ptr")] + #[cfg(target_has_atomic_primitive_alignment = "ptr")] #[unstable(feature = "atomic_from_mut", issue = "76314")] pub fn from_mut(v: &mut *mut T) -> &mut Self { let [] = [(); align_of::>() - align_of::<*mut ()>()]; @@ -1672,7 +1672,7 @@ impl AtomicPtr { /// } /// ``` #[inline] - #[cfg(target_has_atomic_equal_alignment = "ptr")] + #[cfg(target_has_atomic_primitive_alignment = "ptr")] #[unstable(feature = "atomic_from_mut", issue = "76314")] pub fn from_mut_slice(v: &mut [*mut T]) -> &mut [Self] { // SAFETY: @@ -3621,7 +3621,7 @@ macro_rules! atomic_int { #[cfg(target_has_atomic_load_store = "8")] atomic_int! { cfg(target_has_atomic = "8"), - cfg(target_has_atomic_equal_alignment = "8"), + cfg(target_has_atomic_primitive_alignment = "8"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3639,7 +3639,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "8")] atomic_int! { cfg(target_has_atomic = "8"), - cfg(target_has_atomic_equal_alignment = "8"), + cfg(target_has_atomic_primitive_alignment = "8"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3657,7 +3657,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "16")] atomic_int! { cfg(target_has_atomic = "16"), - cfg(target_has_atomic_equal_alignment = "16"), + cfg(target_has_atomic_primitive_alignment = "16"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3675,7 +3675,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "16")] atomic_int! { cfg(target_has_atomic = "16"), - cfg(target_has_atomic_equal_alignment = "16"), + cfg(target_has_atomic_primitive_alignment = "16"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3693,7 +3693,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "32")] atomic_int! { cfg(target_has_atomic = "32"), - cfg(target_has_atomic_equal_alignment = "32"), + cfg(target_has_atomic_primitive_alignment = "32"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3711,7 +3711,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "32")] atomic_int! { cfg(target_has_atomic = "32"), - cfg(target_has_atomic_equal_alignment = "32"), + cfg(target_has_atomic_primitive_alignment = "32"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3729,7 +3729,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "64")] atomic_int! { cfg(target_has_atomic = "64"), - cfg(target_has_atomic_equal_alignment = "64"), + cfg(target_has_atomic_primitive_alignment = "64"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3747,7 +3747,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "64")] atomic_int! { cfg(target_has_atomic = "64"), - cfg(target_has_atomic_equal_alignment = "64"), + cfg(target_has_atomic_primitive_alignment = "64"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), stable(feature = "integer_atomics_stable", since = "1.34.0"), @@ -3765,7 +3765,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "128")] atomic_int! { cfg(target_has_atomic = "128"), - cfg(target_has_atomic_equal_alignment = "128"), + cfg(target_has_atomic_primitive_alignment = "128"), unstable(feature = "integer_atomics", issue = "99069"), unstable(feature = "integer_atomics", issue = "99069"), unstable(feature = "integer_atomics", issue = "99069"), @@ -3783,7 +3783,7 @@ atomic_int! { #[cfg(target_has_atomic_load_store = "128")] atomic_int! { cfg(target_has_atomic = "128"), - cfg(target_has_atomic_equal_alignment = "128"), + cfg(target_has_atomic_primitive_alignment = "128"), unstable(feature = "integer_atomics", issue = "99069"), unstable(feature = "integer_atomics", issue = "99069"), unstable(feature = "integer_atomics", issue = "99069"), @@ -3805,7 +3805,7 @@ macro_rules! atomic_int_ptr_sized { #[cfg(target_pointer_width = $target_pointer_width)] atomic_int! { cfg(target_has_atomic = "ptr"), - cfg(target_has_atomic_equal_alignment = "ptr"), + cfg(target_has_atomic_primitive_alignment = "ptr"), stable(feature = "rust1", since = "1.0.0"), stable(feature = "extended_compare_and_swap", since = "1.10.0"), stable(feature = "atomic_debug", since = "1.3.0"), @@ -3823,7 +3823,7 @@ macro_rules! atomic_int_ptr_sized { #[cfg(target_pointer_width = $target_pointer_width)] atomic_int! { cfg(target_has_atomic = "ptr"), - cfg(target_has_atomic_equal_alignment = "ptr"), + cfg(target_has_atomic_primitive_alignment = "ptr"), stable(feature = "rust1", since = "1.0.0"), stable(feature = "extended_compare_and_swap", since = "1.10.0"), stable(feature = "atomic_debug", since = "1.3.0"), diff --git a/src/doc/rustc/src/check-cfg.md b/src/doc/rustc/src/check-cfg.md index dfe036bf1bb19..ef791b57895ab 100644 --- a/src/doc/rustc/src/check-cfg.md +++ b/src/doc/rustc/src/check-cfg.md @@ -99,7 +99,7 @@ the need to specify them manually. Well known names and values are implicitly added as long as at least one `--check-cfg` argument is present. -As of `2025-01-02T`, the list of known names is as follows: +As of `2026-05-15T`, the list of known names is as follows: @@ -122,15 +122,17 @@ As of `2025-01-02T`, the list of known names is as follows: - `target_endian` - `target_env` - `target_family` + - `target_object_format` - `target_feature` - `target_has_atomic` - - `target_has_atomic_equal_alignment` + - `target_has_atomic_primitive_alignment` - `target_has_atomic_load_store` - `target_os` - `target_pointer_width` - `target_thread_local` - `target_vendor` - `ub_checks` + - `contract_checks` - `unix` - `windows` diff --git a/tests/ui/cfg/disallowed-cli-cfgs.rs b/tests/ui/cfg/disallowed-cli-cfgs.rs index 1ce65a7d657e6..81f3d9313ef1f 100644 --- a/tests/ui/cfg/disallowed-cli-cfgs.rs +++ b/tests/ui/cfg/disallowed-cli-cfgs.rs @@ -1,10 +1,12 @@ +// ignore-tidy-linelength (target_has_atomic_primitive_alignment below overflows the linelength limit and @ [revision]compile-flags isn't detected by tidy as something to ignore) + //@ check-fail //@ revisions: overflow_checks_ debug_assertions_ ub_checks_ sanitize_ //@ revisions: sanitizer_cfi_generalize_pointers_ sanitizer_cfi_normalize_integers_ //@ revisions: proc_macro_ panic_ target_feature_ unix_ windows_ target_abi_ //@ revisions: target_arch_ target_endian_ target_env_ target_family_ target_os_ //@ revisions: target_object_format_ target_pointer_width_ target_vendor_ -//@ revisions: target_has_atomic_ target_has_atomic_equal_alignment_ +//@ revisions: target_has_atomic_ target_has_atomic_primitive_alignment_ //@ revisions: target_has_atomic_load_store_ target_thread_local_ relocation_model_ //@ revisions: fmt_debug_ //@ revisions: emscripten_wasm_eh_ @@ -31,7 +33,7 @@ //@ [target_pointer_width_]compile-flags: --cfg target_pointer_width="32" //@ [target_vendor_]compile-flags: --cfg target_vendor //@ [target_has_atomic_]compile-flags: --cfg target_has_atomic="32" -//@ [target_has_atomic_equal_alignment_]compile-flags: --cfg target_has_atomic_equal_alignment="32" +//@ [target_has_atomic_primitive_alignment_]compile-flags: --cfg target_has_atomic_primitive_alignment="32" //@ [target_has_atomic_load_store_]compile-flags: --cfg target_has_atomic_load_store="32" //@ [target_thread_local_]compile-flags: --cfg target_thread_local //@ [relocation_model_]compile-flags: --cfg relocation_model="a" diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr index 096490a03f610..3cdc06822700c 100644 --- a/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr +++ b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr @@ -1,6 +1,6 @@ -error: unexpected `--cfg target_has_atomic_equal_alignment="32"` flag +error: unexpected `--cfg target_has_atomic_primitive_alignment="32"` flag | - = note: config `target_has_atomic_equal_alignment` is only supposed to be controlled by `--target` + = note: config `target_has_atomic_primitive_alignment` is only supposed to be controlled by `--target` = note: manually setting a built-in cfg can and does create incoherent behaviors = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_primitive_alignment_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_primitive_alignment_.stderr new file mode 100644 index 0000000000000..3cdc06822700c --- /dev/null +++ b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_primitive_alignment_.stderr @@ -0,0 +1,8 @@ +error: unexpected `--cfg target_has_atomic_primitive_alignment="32"` flag + | + = note: config `target_has_atomic_primitive_alignment` is only supposed to be controlled by `--target` + = note: manually setting a built-in cfg can and does create incoherent behaviors + = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default + +error: aborting due to 1 previous error + diff --git a/tests/ui/check-cfg/well-known-names.stderr b/tests/ui/check-cfg/well-known-names.stderr index d946377f2616b..ec1345fd6b3cd 100644 --- a/tests/ui/check-cfg/well-known-names.stderr +++ b/tests/ui/check-cfg/well-known-names.stderr @@ -26,8 +26,8 @@ LL | #[cfg(list_all_well_known_cfgs)] `target_family` `target_feature` `target_has_atomic` -`target_has_atomic_equal_alignment` `target_has_atomic_load_store` +`target_has_atomic_primitive_alignment` `target_object_format` `target_os` `target_pointer_width` diff --git a/tests/ui/check-cfg/well-known-values.rs b/tests/ui/check-cfg/well-known-values.rs index f48438d142467..5f961989d720f 100644 --- a/tests/ui/check-cfg/well-known-values.rs +++ b/tests/ui/check-cfg/well-known-values.rs @@ -13,7 +13,6 @@ #![feature(cfg_relocation_model)] #![feature(cfg_sanitize)] #![feature(cfg_target_has_atomic)] -#![feature(cfg_target_has_atomic_equal_alignment)] #![feature(cfg_target_thread_local)] #![feature(cfg_target_object_format)] #![feature(cfg_ub_checks)] @@ -65,10 +64,10 @@ // ^ tested in target_feature.rs target_has_atomic = "_UNEXPECTED_VALUE", //~^ WARN unexpected `cfg` condition value - target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE", - //~^ WARN unexpected `cfg` condition value target_has_atomic_load_store = "_UNEXPECTED_VALUE", //~^ WARN unexpected `cfg` condition value + target_has_atomic_primitive_alignment = "_UNEXPECTED_VALUE", + //~^ WARN unexpected `cfg` condition value target_object_format = "_UNEXPECTED_VALUE", //~^ WARN unexpected `cfg` condition value target_os = "_UNEXPECTED_VALUE", diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr index dd1b696b76cb2..47ed9891a1a6c 100644 --- a/tests/ui/check-cfg/well-known-values.stderr +++ b/tests/ui/check-cfg/well-known-values.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:30:5 + --> $DIR/well-known-values.rs:29:5 | LL | clippy = "_UNEXPECTED_VALUE", | ^^^^^^---------------------- @@ -11,7 +11,7 @@ LL | clippy = "_UNEXPECTED_VALUE", = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:32:5 + --> $DIR/well-known-values.rs:31:5 | LL | debug_assertions = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^---------------------- @@ -22,7 +22,7 @@ LL | debug_assertions = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:34:5 + --> $DIR/well-known-values.rs:33:5 | LL | doc = "_UNEXPECTED_VALUE", | ^^^---------------------- @@ -33,7 +33,7 @@ LL | doc = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:36:5 + --> $DIR/well-known-values.rs:35:5 | LL | doctest = "_UNEXPECTED_VALUE", | ^^^^^^^---------------------- @@ -44,7 +44,7 @@ LL | doctest = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:38:5 + --> $DIR/well-known-values.rs:37:5 | LL | fmt_debug = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -53,7 +53,7 @@ LL | fmt_debug = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:40:5 + --> $DIR/well-known-values.rs:39:5 | LL | miri = "_UNEXPECTED_VALUE", | ^^^^---------------------- @@ -64,7 +64,7 @@ LL | miri = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:42:5 + --> $DIR/well-known-values.rs:41:5 | LL | overflow_checks = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^---------------------- @@ -75,7 +75,7 @@ LL | overflow_checks = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:44:5 + --> $DIR/well-known-values.rs:43:5 | LL | panic = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -84,7 +84,7 @@ LL | panic = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:46:5 + --> $DIR/well-known-values.rs:45:5 | LL | proc_macro = "_UNEXPECTED_VALUE", | ^^^^^^^^^^---------------------- @@ -95,7 +95,7 @@ LL | proc_macro = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:48:5 + --> $DIR/well-known-values.rs:47:5 | LL | relocation_model = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -104,7 +104,7 @@ LL | relocation_model = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:50:5 + --> $DIR/well-known-values.rs:49:5 | LL | rustfmt = "_UNEXPECTED_VALUE", | ^^^^^^^---------------------- @@ -115,7 +115,7 @@ LL | rustfmt = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:52:5 + --> $DIR/well-known-values.rs:51:5 | LL | sanitize = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -124,7 +124,7 @@ LL | sanitize = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:54:5 + --> $DIR/well-known-values.rs:53:5 | LL | target_abi = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -133,7 +133,7 @@ LL | target_abi = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:56:5 + --> $DIR/well-known-values.rs:55:5 | LL | target_arch = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -142,7 +142,7 @@ LL | target_arch = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:58:5 + --> $DIR/well-known-values.rs:57:5 | LL | target_endian = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -151,7 +151,7 @@ LL | target_endian = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:60:5 + --> $DIR/well-known-values.rs:59:5 | LL | target_env = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -160,7 +160,7 @@ LL | target_env = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:62:5 + --> $DIR/well-known-values.rs:61:5 | LL | target_family = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -169,7 +169,7 @@ LL | target_family = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:66:5 + --> $DIR/well-known-values.rs:65:5 | LL | target_has_atomic = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -178,25 +178,25 @@ LL | target_has_atomic = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:68:5 + --> $DIR/well-known-values.rs:67:5 | -LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE", - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: expected values for `target_has_atomic_equal_alignment` are: (none), `128`, `16`, `32`, `64`, `8`, and `ptr` + = note: expected values for `target_has_atomic_load_store` are: (none), `128`, `16`, `32`, `64`, `8`, and `ptr` = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:70:5 + --> $DIR/well-known-values.rs:69:5 | -LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE", - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | target_has_atomic_primitive_alignment = "_UNEXPECTED_VALUE", + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: expected values for `target_has_atomic_load_store` are: (none), `128`, `16`, `32`, `64`, `8`, and `ptr` + = note: expected values for `target_has_atomic_primitive_alignment` are: `128`, `16`, `32`, `64`, `8`, and `ptr` = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:72:5 + --> $DIR/well-known-values.rs:71:5 | LL | target_object_format = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -205,7 +205,7 @@ LL | target_object_format = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:74:5 + --> $DIR/well-known-values.rs:73:5 | LL | target_os = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -214,7 +214,7 @@ LL | target_os = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:76:5 + --> $DIR/well-known-values.rs:75:5 | LL | target_pointer_width = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -223,7 +223,7 @@ LL | target_pointer_width = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:78:5 + --> $DIR/well-known-values.rs:77:5 | LL | target_thread_local = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^---------------------- @@ -234,7 +234,7 @@ LL | target_thread_local = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:80:5 + --> $DIR/well-known-values.rs:79:5 | LL | target_vendor = "_UNEXPECTED_VALUE", | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -243,7 +243,7 @@ LL | target_vendor = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:82:5 + --> $DIR/well-known-values.rs:81:5 | LL | ub_checks = "_UNEXPECTED_VALUE", | ^^^^^^^^^---------------------- @@ -254,7 +254,7 @@ LL | ub_checks = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:84:5 + --> $DIR/well-known-values.rs:83:5 | LL | unix = "_UNEXPECTED_VALUE", | ^^^^---------------------- @@ -265,7 +265,7 @@ LL | unix = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE` - --> $DIR/well-known-values.rs:86:5 + --> $DIR/well-known-values.rs:85:5 | LL | windows = "_UNEXPECTED_VALUE", | ^^^^^^^---------------------- @@ -276,7 +276,7 @@ LL | windows = "_UNEXPECTED_VALUE", = note: see for more information about checking conditional configuration warning: unexpected `cfg` condition value: `linuz` - --> $DIR/well-known-values.rs:92:7 + --> $DIR/well-known-values.rs:91:7 | LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux` | ^^^^^^^^^^^^------- diff --git a/tests/ui/feature-gates/feature-gate-cfg-target-has-atomic-equal-alignment.rs b/tests/ui/feature-gates/feature-gate-cfg-target-has-atomic-equal-alignment.rs deleted file mode 100644 index 3d692a0700197..0000000000000 --- a/tests/ui/feature-gates/feature-gate-cfg-target-has-atomic-equal-alignment.rs +++ /dev/null @@ -1,14 +0,0 @@ -fn main() { - cfg!(target_has_atomic_equal_alignment = "8"); - //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - cfg!(target_has_atomic_equal_alignment = "16"); - //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - cfg!(target_has_atomic_equal_alignment = "32"); - //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - cfg!(target_has_atomic_equal_alignment = "64"); - //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - cfg!(target_has_atomic_equal_alignment = "128"); - //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - cfg!(target_has_atomic_equal_alignment = "ptr"); - //~^ ERROR `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change -} diff --git a/tests/ui/feature-gates/feature-gate-cfg-target-has-atomic-equal-alignment.stderr b/tests/ui/feature-gates/feature-gate-cfg-target-has-atomic-equal-alignment.stderr deleted file mode 100644 index 8d5d232ccc485..0000000000000 --- a/tests/ui/feature-gates/feature-gate-cfg-target-has-atomic-equal-alignment.stderr +++ /dev/null @@ -1,63 +0,0 @@ -error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - --> $DIR/feature-gate-cfg-target-has-atomic-equal-alignment.rs:2:10 - | -LL | cfg!(target_has_atomic_equal_alignment = "8"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #93822 for more information - = help: add `#![feature(cfg_target_has_atomic_equal_alignment)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - --> $DIR/feature-gate-cfg-target-has-atomic-equal-alignment.rs:4:10 - | -LL | cfg!(target_has_atomic_equal_alignment = "16"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #93822 for more information - = help: add `#![feature(cfg_target_has_atomic_equal_alignment)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - --> $DIR/feature-gate-cfg-target-has-atomic-equal-alignment.rs:6:10 - | -LL | cfg!(target_has_atomic_equal_alignment = "32"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #93822 for more information - = help: add `#![feature(cfg_target_has_atomic_equal_alignment)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - --> $DIR/feature-gate-cfg-target-has-atomic-equal-alignment.rs:8:10 - | -LL | cfg!(target_has_atomic_equal_alignment = "64"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #93822 for more information - = help: add `#![feature(cfg_target_has_atomic_equal_alignment)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - --> $DIR/feature-gate-cfg-target-has-atomic-equal-alignment.rs:10:10 - | -LL | cfg!(target_has_atomic_equal_alignment = "128"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #93822 for more information - = help: add `#![feature(cfg_target_has_atomic_equal_alignment)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: `cfg(target_has_atomic_equal_alignment)` is experimental and subject to change - --> $DIR/feature-gate-cfg-target-has-atomic-equal-alignment.rs:12:10 - | -LL | cfg!(target_has_atomic_equal_alignment = "ptr"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #93822 for more information - = help: add `#![feature(cfg_target_has_atomic_equal_alignment)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs b/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs index b7c7f0ed98241..e8aad9cbeb9fa 100644 --- a/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs +++ b/tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs @@ -1,11 +1,11 @@ -//! This test exercises the combined effect of the `cfg(target_has_atomic_equal_alignment = "...")` -//! implementation in the compiler plus usage of said `cfg(target_has_atomic_equal_alignment)` in -//! `core` for the `Atomic64::from_mut` API. +//! This test exercises the combined effect of the +//! `cfg(target_has_atomic_primitive_alignment = "...")` implementation in the compiler plus usage +//! of said `cfg(target_has_atomic_primitive_alignment)` in `core` for the `Atomic64::from_mut` API. //! //! This test is a basic smoke test: that `AtomicU64::from_mut` is gated by -//! `#[cfg(target_has_atomic_equal_alignment = "8")]`, which is only available on platforms where -//! `AtomicU64` has the same alignment as `u64`. This is notably *not* satisfied by `x86_32`, where -//! they have differing alignments. Thus, `AtomicU64::from_mut` should *not* be available on +//! `#[cfg(target_has_atomic_primitive_alignment = "64")]`, which is only available on platforms +//! where `AtomicU64` has the same alignment as `u64`. This is notably *not* satisfied by `x86_32`, +//! where they have differing alignments. Thus, `AtomicU64::from_mut` should *not* be available on //! `x86_32` linux and should report assoc item not found, if the `cfg` is working correctly. //! Conversely, `AtomicU64::from_mut` *should* be available on `x86_64` linux where the alignment //! matches.