mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Add #[deny(unsafe_op_in_unsafe_fn)] to thread_local!(const).
This avoids 'unused unsafe' warnings when using this feature inside std.
This commit is contained in:
parent
83e8b9e4dd
commit
5b2591299a
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user