Skip to content

Commit 8a0c633

Browse files
authored
Collapse double unsafe block
1 parent fe19861 commit 8a0c633

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

library/std/src/thread/local.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,12 @@ macro_rules! __thread_local_inner {
208208
// If a dtor isn't needed we can do something "very raw" and
209209
// just get going.
210210
if !$crate::mem::needs_drop::<$t>() {
211+
// FIXME: remove the #[allow(...)] marker when macros don't
212+
// raise warning for missing/extraneous unsafe blocks anymore.
213+
// See https://github.com/rust-lang/rust/issues/74838.
214+
#[allow(unused_unsafe)]
211215
unsafe {
212-
// FIXME: remove the #[allow(...)] marker when macros don't
213-
// raise warning for missing/extraneous unsafe blocks anymore.
214-
// See https://github.com/rust-lang/rust/issues/74838.
215-
#[allow(unused_unsafe)]
216-
unsafe {
217-
return Some(&VAL);
218-
}
216+
return Some(&VAL);
219217
}
220218
}
221219

0 commit comments

Comments
 (0)