File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,11 @@ macro_rules! __thread_local_inner {
189189 #[ cfg( all( target_family = "wasm" , not( target_feature = "atomics" ) ) ) ]
190190 {
191191 static mut VAL : $t = INIT_EXPR ;
192- Some ( & VAL )
192+ // FIXME: remove the #[allow(...)] marker when macros don't
193+ // raise warning for missing/extraneous unsafe blocks anymore.
194+ // See https://github.com/rust-lang/rust/issues/74838.
195+ #[ allow( unused_unsafe) ]
196+ unsafe { Some ( & VAL ) }
193197 }
194198
195199 // If the platform has support for `#[thread_local]`, use it.
@@ -205,7 +209,13 @@ macro_rules! __thread_local_inner {
205209 // just get going.
206210 if !$crate:: mem:: needs_drop:: <$t>( ) {
207211 unsafe {
208- return Some ( & VAL )
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+ }
209219 }
210220 }
211221
You can’t perform that action at this time.
0 commit comments