]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys/sgx/mod.rs
Document that `init` and `cleanup` are not guaranteed to run
[rust.git] / library / std / src / sys / sgx / mod.rs
index 25250d060d04bb893a3fbc2aec84acafb1a5820e..059d6cb5ba13122994c69ee86439d1be1fe1181a 100644 (file)
@@ -40,6 +40,7 @@
 pub use crate::sys_common::os_str_bytes as os_str;
 
 // SAFETY: must be called only once during runtime initialization.
+// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
 pub unsafe fn init(argc: isize, argv: *const *const u8) {
     unsafe {
         args::init(argc, argv);
@@ -47,6 +48,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
 }
 
 // SAFETY: must be called only once during runtime cleanup.
+// NOTE: this is not guaranteed to run, for example when the program aborts.
 pub unsafe fn cleanup() {}
 
 /// This function is used to implement functionality that simply doesn't exist.