File tree 1 file changed +12
-2
lines changed
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 {
189
189
#[ cfg( all( target_family = "wasm" , not( target_feature = "atomics" ) ) ) ]
190
190
{
191
191
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 ) }
193
197
}
194
198
195
199
// If the platform has support for `#[thread_local]`, use it.
@@ -205,7 +209,13 @@ macro_rules! __thread_local_inner {
205
209
// just get going.
206
210
if !$crate:: mem:: needs_drop:: <$t>( ) {
207
211
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
+ }
209
219
}
210
220
}
211
221
You can’t perform that action at this time.
0 commit comments