File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -796,8 +796,14 @@ impl CodeGenerator for Var {
796
796
quote ! { mut }
797
797
} ;
798
798
799
+ let safety = ctx
800
+ . options ( )
801
+ . rust_features
802
+ . unsafe_extern_blocks
803
+ . then ( || quote ! ( unsafe ) ) ;
804
+
799
805
let tokens = quote ! (
800
- extern "C" {
806
+ #safety extern "C" {
801
807
#( #attrs) *
802
808
pub static #maybe_mut #canonical_ident: #ty;
803
809
}
@@ -4670,9 +4676,16 @@ impl CodeGenerator for Function {
4670
4676
let ret = utils:: fnsig_return_ty ( ctx, signature) ;
4671
4677
4672
4678
let ident = ctx. rust_ident ( ident) ;
4679
+
4680
+ let safety = ctx
4681
+ . options ( )
4682
+ . rust_features
4683
+ . unsafe_extern_blocks
4684
+ . then ( || quote ! ( unsafe ) ) ;
4685
+
4673
4686
let tokens = quote ! {
4674
4687
#wasm_link_attribute
4675
- extern #abi {
4688
+ #safety extern #abi {
4676
4689
#( #attributes) *
4677
4690
pub fn #ident ( #( #args ) , * ) #ret;
4678
4691
}
Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ define_rust_targets! {
254
254
ptr_metadata: #81513 ,
255
255
layout_for_ptr: #69835 ,
256
256
} ,
257
+ Stable_1_82 ( 82 ) => {
258
+ unsafe_extern_blocks: #127921 ,
259
+ } ,
257
260
Stable_1_77 ( 77 ) => {
258
261
offset_of: #106655 ,
259
262
literal_cstr( 2021 ) |( 2024 ) : #117472 ,
You can’t perform that action at this time.
0 commit comments