diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2022-04-06 22:22:43 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2022-04-12 08:44:39 +0200 |
| commit | 5b2591299a2c179301849e76cc137b0e39b68367 (patch) | |
| tree | 8393f9211bdf2bdb9a8844cd682887f4cae7aaf9 /library/std/src/thread | |
| parent | 83e8b9e4ddf41def776ad7d3724f308e689ad063 (diff) | |
| download | rust-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.rs | 1 |
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> { |
