1313//! compiling for wasm. That way it's a compile time error for something that's 
1414//! guaranteed to be a runtime error! 
1515
16- #![ allow( missing_docs,  nonstandard_style,  unsafe_op_in_unsafe_fn) ]  
16+ #![ deny( unsafe_op_in_unsafe_fn) ]  
17+ #![ allow( missing_docs,  nonstandard_style) ]  
1718
1819use  crate :: os:: raw:: c_char; 
1920
@@ -78,7 +79,9 @@ pub extern "C" fn __rust_abort() {
7879// SAFETY: must be called only once during runtime initialization. 
7980// NOTE: this is not guaranteed to run, for example when Rust code is called externally. 
8081pub  unsafe  fn  init ( argc :  isize ,  argv :  * const  * const  u8 ,  _sigpipe :  u8 )  { 
81-     args:: init ( argc,  argv) ; 
82+     unsafe  { 
83+         args:: init ( argc,  argv) ; 
84+     } 
8285} 
8386
8487// SAFETY: must be called only once during runtime cleanup. 
@@ -99,10 +102,12 @@ pub unsafe extern "C" fn runtime_entry(
99102    // initialize environment 
100103    os:: init_environment ( env as  * const  * const  i8 ) ; 
101104
102-     let  result = main ( argc as  isize ,  argv) ; 
105+     let  result = unsafe   {   main ( argc as  isize ,  argv)   } ; 
103106
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)  } 
106111} 
107112
108113#[ inline]  
0 commit comments