File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,11 @@ macro_rules! __thread_local_inner {
193
193
#[ cfg( all( target_family = "wasm" , not( target_feature = "atomics" ) ) ) ]
194
194
{
195
195
static mut VAL : $t = INIT_EXPR ;
196
- $crate:: option:: Option :: Some ( & VAL )
196
+ // FIXME: remove the #[allow(...)] marker when macros don't
197
+ // raise warning for missing/extraneous unsafe blocks anymore.
198
+ // See https://github.com/rust-lang/rust/issues/74838.
199
+ #[ allow( unused_unsafe) ]
200
+ unsafe { $crate:: option:: Option :: Some ( & VAL ) }
197
201
}
198
202
199
203
// If the platform has support for `#[thread_local]`, use it.
@@ -208,8 +212,12 @@ macro_rules! __thread_local_inner {
208
212
// If a dtor isn't needed we can do something "very raw" and
209
213
// just get going.
210
214
if !$crate:: mem:: needs_drop:: <$t>( ) {
215
+ // FIXME: remove the #[allow(...)] marker when macros don't
216
+ // raise warning for missing/extraneous unsafe blocks anymore.
217
+ // See https://github.com/rust-lang/rust/issues/74838.
218
+ #[ allow( unused_unsafe) ]
211
219
unsafe {
212
- return $crate:: option:: Option :: Some ( & VAL )
220
+ return $crate:: option:: Option :: Some ( & VAL ) ;
213
221
}
214
222
}
215
223
You can’t perform that action at this time.
0 commit comments