about summary refs log tree commit diff
path: root/library/std/src/thread
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2022-04-06 22:22:43 +0200
committerMara Bos <m-ou.se@m-ou.se>2022-04-12 08:44:39 +0200
commit5b2591299a2c179301849e76cc137b0e39b68367 (patch)
tree8393f9211bdf2bdb9a8844cd682887f4cae7aaf9 /library/std/src/thread
parent83e8b9e4ddf41def776ad7d3724f308e689ad063 (diff)
downloadrust-5b2591299a2c179301849e76cc137b0e39b68367.tar.gz
rust-5b2591299a2c179301849e76cc137b0e39b68367.zip
Add #[deny(unsafe_op_in_unsafe_fn)] to thread_local!(const).
This avoids 'unused unsafe' warnings when using this feature inside std.
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/local.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs
index fc307c5666d..99baca66df0 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -179,6 +179,7 @@ macro_rules! __thread_local_inner {
     // used to generate the `LocalKey` value for const-initialized thread locals
     (@key $t:ty, const $init:expr) => {{
         #[cfg_attr(not(windows), inline(always))] // see comments below
+        #[deny(unsafe_op_in_unsafe_fn)]
         unsafe fn __getit(
             _init: $crate::option::Option<&mut $crate::option::Option<$t>>,
         ) -> $crate::option::Option<&'static $t> {