diff options
| author | Obei Sideg <obei.sideg@gmail.com> | 2024-02-17 22:01:56 +0300 |
|---|---|---|
| committer | Obei Sideg <obei.sideg@gmail.com> | 2024-02-18 06:01:40 +0300 |
| commit | 408eeae59d35cbcaab2cfb345d24373954e74fc5 (patch) | |
| tree | 96f35aa95f6fba769db2c292965e8a7ec9c09498 /library/std/src | |
| parent | eeeb021954e30a6b16fc12cc4b8a1bcf7910a40e (diff) | |
| download | rust-408eeae59d35cbcaab2cfb345d24373954e74fc5.tar.gz rust-408eeae59d35cbcaab2cfb345d24373954e74fc5.zip | |
Improve wording of static_mut_ref
Rename `static_mut_ref` lint to `static_mut_refs`.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/panicking.rs | 5 | ||||
| -rw-r--r-- | library/std/src/sys/pal/common/thread_local/fast_local.rs | 5 | ||||
| -rw-r--r-- | library/std/src/sys/pal/common/thread_local/static_local.rs | 5 | ||||
| -rw-r--r-- | library/std/src/thread/local.rs | 4 |
4 files changed, 11 insertions, 8 deletions
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 8294160b72c..c8306c1b597 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -337,8 +337,9 @@ pub mod panic_count { #[doc(hidden)] #[cfg(not(feature = "panic_immediate_abort"))] #[unstable(feature = "update_panic_count", issue = "none")] -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[allow(static_mut_ref)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[cfg_attr(bootstrap, allow(static_mut_ref))] +#[cfg_attr(not(bootstrap), allow(static_mut_refs))] pub mod panic_count { use crate::cell::Cell; use crate::sync::atomic::{AtomicUsize, Ordering}; diff --git a/library/std/src/sys/pal/common/thread_local/fast_local.rs b/library/std/src/sys/pal/common/thread_local/fast_local.rs index 04c0dd6f750..646dcd7f3a3 100644 --- a/library/std/src/sys/pal/common/thread_local/fast_local.rs +++ b/library/std/src/sys/pal/common/thread_local/fast_local.rs @@ -13,8 +13,9 @@ pub macro thread_local_inner { (@key $t:ty, const $init:expr) => {{ #[inline] #[deny(unsafe_op_in_unsafe_fn)] - // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint - #[allow(static_mut_ref)] + // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint + #[cfg_attr(bootstrap, allow(static_mut_ref))] + #[cfg_attr(not(bootstrap), allow(static_mut_refs))] unsafe fn __getit( _init: $crate::option::Option<&mut $crate::option::Option<$t>>, ) -> $crate::option::Option<&'static $t> { diff --git a/library/std/src/sys/pal/common/thread_local/static_local.rs b/library/std/src/sys/pal/common/thread_local/static_local.rs index 0dde78b14db..4f2b6868962 100644 --- a/library/std/src/sys/pal/common/thread_local/static_local.rs +++ b/library/std/src/sys/pal/common/thread_local/static_local.rs @@ -11,8 +11,9 @@ pub macro thread_local_inner { (@key $t:ty, const $init:expr) => {{ #[inline] // see comments below #[deny(unsafe_op_in_unsafe_fn)] - // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint - #[allow(static_mut_ref)] + // FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint + #[cfg_attr(bootstrap, allow(static_mut_ref))] + #[cfg_attr(not(bootstrap), allow(static_mut_refs))] unsafe fn __getit( _init: $crate::option::Option<&mut $crate::option::Option<$t>>, ) -> $crate::option::Option<&'static $t> { diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 83d5d63556f..d1213e2f166 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -180,8 +180,8 @@ impl<T: 'static> fmt::Debug for LocalKey<T> { #[stable(feature = "rust1", since = "1.0.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "thread_local_macro")] #[allow_internal_unstable(thread_local_internals)] -// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint -#[allow(static_mut_ref)] +// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint +#[cfg_attr(not(bootstrap), allow(static_mut_refs))] macro_rules! thread_local { // empty (base case for the recursion) () => {}; |
