13
13
//! compiling for wasm. That way it's a compile time error for something that's
14
14
//! guaranteed to be a runtime error!
15
15
16
- #![ allow( missing_docs, nonstandard_style, unsafe_op_in_unsafe_fn) ]
16
+ #![ deny( unsafe_op_in_unsafe_fn) ]
17
+ #![ allow( missing_docs, nonstandard_style) ]
17
18
18
19
use crate :: os:: raw:: c_char;
19
20
@@ -78,7 +79,9 @@ pub extern "C" fn __rust_abort() {
78
79
// SAFETY: must be called only once during runtime initialization.
79
80
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
80
81
pub unsafe fn init ( argc : isize , argv : * const * const u8 , _sigpipe : u8 ) {
81
- args:: init ( argc, argv) ;
82
+ unsafe {
83
+ args:: init ( argc, argv) ;
84
+ }
82
85
}
83
86
84
87
// SAFETY: must be called only once during runtime cleanup.
@@ -99,10 +102,12 @@ pub unsafe extern "C" fn runtime_entry(
99
102
// initialize environment
100
103
os:: init_environment ( env as * const * const i8 ) ;
101
104
102
- let result = main ( argc as isize , argv) ;
105
+ let result = unsafe { main ( argc as isize , argv) } ;
103
106
104
- crate :: sys:: thread_local:: destructors:: run ( ) ;
105
- hermit_abi:: exit ( result)
107
+ unsafe {
108
+ crate :: sys:: thread_local:: destructors:: run ( ) ;
109
+ }
110
+ unsafe { hermit_abi:: exit ( result) }
106
111
}
107
112
108
113
#[ inline]
0 commit comments