about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorObei Sideg <obei.sideg@gmail.com>2023-12-22 15:12:01 +0300
committerObei Sideg <obei.sideg@gmail.com>2024-01-07 17:29:25 +0300
commita8aa6878f63e53a9b0cfee542e9765407e1ca0d6 (patch)
treebeffa149b8d74a34ca8461831ee1222ec4def133 /library/std/src
parent18edf9a64e8d84e72a6be67df3822e57dea8d34a (diff)
downloadrust-a8aa6878f63e53a9b0cfee542e9765407e1ca0d6.tar.gz
rust-a8aa6878f63e53a9b0cfee542e9765407e1ca0d6.zip
Update test for `E0796` and `static_mut_ref` lint
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/panicking.rs2
-rw-r--r--library/std/src/sys/common/thread_local/fast_local.rs2
-rw-r--r--library/std/src/sys/common/thread_local/static_local.rs2
-rw-r--r--library/std/src/thread/local.rs2
4 files changed, 8 insertions, 0 deletions
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index 66b4ec37c8e..c80f15d8a61 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -337,6 +337,8 @@ 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
+#[cfg_attr(not(bootstrap), allow(static_mut_ref))]
 pub mod panic_count {
     use crate::cell::Cell;
     use crate::sync::atomic::{AtomicUsize, Ordering};
diff --git a/library/std/src/sys/common/thread_local/fast_local.rs b/library/std/src/sys/common/thread_local/fast_local.rs
index c0a9619bf7b..9206588be06 100644
--- a/library/std/src/sys/common/thread_local/fast_local.rs
+++ b/library/std/src/sys/common/thread_local/fast_local.rs
@@ -13,6 +13,8 @@ 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
+        #[cfg_attr(not(bootstrap), allow(static_mut_ref))]
         unsafe fn __getit(
             _init: $crate::option::Option<&mut $crate::option::Option<$t>>,
         ) -> $crate::option::Option<&'static $t> {
diff --git a/library/std/src/sys/common/thread_local/static_local.rs b/library/std/src/sys/common/thread_local/static_local.rs
index 5cb6c541a0e..51cba66fad7 100644
--- a/library/std/src/sys/common/thread_local/static_local.rs
+++ b/library/std/src/sys/common/thread_local/static_local.rs
@@ -11,6 +11,8 @@ 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
+        #[cfg_attr(not(bootstrap), allow(static_mut_ref))]
         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 9cf37b0e634..338567777f7 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -180,6 +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
+#[cfg_attr(not(bootstrap), allow(static_mut_ref))]
 macro_rules! thread_local {
     // empty (base case for the recursion)
     () => {};