Skip to content

Commit 0664b8a

Browse files
committed
Add #[deny(unsafe_op_in_unsafe_fn)] to thread_local!(const).
This avoids 'unused unsafe' warnings when using this feature inside std.
1 parent aeb01c3 commit 0664b8a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/thread/local.rs

+1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ macro_rules! __thread_local_inner {
179179
// used to generate the `LocalKey` value for const-initialized thread locals
180180
(@key $t:ty, const $init:expr) => {{
181181
#[cfg_attr(not(windows), inline(always))] // see comments below
182+
#[deny(unsafe_op_in_unsafe_fn)]
182183
unsafe fn __getit(
183184
_init: $crate::option::Option<&mut $crate::option::Option<$t>>,
184185
) -> $crate::option::Option<&'static $t> {

0 commit comments

Comments
 (0)