File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -800,8 +800,14 @@ impl CodeGenerator for Var {
800
800
quote ! { mut }
801
801
} ;
802
802
803
+ let safety = ctx
804
+ . options ( )
805
+ . rust_features
806
+ . unsafe_extern_blocks
807
+ . then ( || quote ! ( unsafe ) ) ;
808
+
803
809
let tokens = quote ! (
804
- extern "C" {
810
+ #safety extern "C" {
805
811
#( #attrs) *
806
812
pub static #maybe_mut #canonical_ident: #ty;
807
813
}
@@ -4704,9 +4710,16 @@ impl CodeGenerator for Function {
4704
4710
let ret = utils:: fnsig_return_ty ( ctx, signature) ;
4705
4711
4706
4712
let ident = ctx. rust_ident ( ident) ;
4713
+
4714
+ let safety = ctx
4715
+ . options ( )
4716
+ . rust_features
4717
+ . unsafe_extern_blocks
4718
+ . then ( || quote ! ( unsafe ) ) ;
4719
+
4707
4720
let tokens = quote ! {
4708
4721
#wasm_link_attribute
4709
- extern #abi {
4722
+ #safety extern #abi {
4710
4723
#( #attributes) *
4711
4724
pub fn #ident ( #( #args ) , * ) #ret;
4712
4725
}
Original file line number Diff line number Diff line change @@ -255,6 +255,9 @@ define_rust_targets! {
255
255
ptr_metadata: #81513 ,
256
256
layout_for_ptr: #69835 ,
257
257
} ,
258
+ Stable_1_82 ( 82 ) => {
259
+ unsafe_extern_blocks: #127921 ,
260
+ } ,
258
261
Stable_1_77 ( 77 ) => {
259
262
offset_of: #106655 ,
260
263
literal_cstr( 2021 ) |( 2024 ) : #117472 ,
You can’t perform that action at this time.
0 commit comments