File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 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 {
193193 #[ cfg( all( target_family = "wasm" , not( target_feature = "atomics" ) ) ) ]
194194 {
195195 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 ) }
197201 }
198202
199203 // If the platform has support for `#[thread_local]`, use it.
@@ -208,8 +212,12 @@ macro_rules! __thread_local_inner {
208212 // If a dtor isn't needed we can do something "very raw" and
209213 // just get going.
210214 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) ]
211219 unsafe {
212- return $crate:: option:: Option :: Some ( & VAL )
220+ return $crate:: option:: Option :: Some ( & VAL ) ;
213221 }
214222 }
215223
You can’t perform that action at this time.
0 commit comments