about summary refs log tree commit diff
path: root/library/std/src/sys_common/rt.rs
diff options
context:
space:
mode:
authorChristiaan Dirkx <christiaan@dirkx.email>2021-04-18 07:19:39 +0200
committerChristiaan Dirkx <christiaan@dirkx.email>2021-04-22 18:00:18 +0200
commite1b1081d2ff80f49129da2002ce3f5efa6186825 (patch)
treedcc0b789e324332e48071fe55131a9d62e6ec03f /library/std/src/sys_common/rt.rs
parent8aeea227daf4a78761c41bb32321e8b2e505d27e (diff)
downloadrust-e1b1081d2ff80f49129da2002ce3f5efa6186825.tar.gz
rust-e1b1081d2ff80f49129da2002ce3f5efa6186825.zip
Document that `init` and `cleanup` are not guaranteed to run
Diffstat (limited to 'library/std/src/sys_common/rt.rs')
-rw-r--r--library/std/src/sys_common/rt.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/sys_common/rt.rs b/library/std/src/sys_common/rt.rs
index 5906b4e3e0e..c0c4a63cde9 100644
--- a/library/std/src/sys_common/rt.rs
+++ b/library/std/src/sys_common/rt.rs
@@ -5,6 +5,7 @@ use crate::thread::Thread;
 
 // One-time runtime initialization.
 // Runs before `main`.
+// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
 #[cfg_attr(test, allow(dead_code))]
 pub fn init(argc: isize, argv: *const *const u8) {
     static INIT: Once = Once::new();
@@ -23,8 +24,8 @@ pub fn init(argc: isize, argv: *const *const u8) {
 }
 
 // One-time runtime cleanup.
-// Runs after `main` or at program exit. Note however that this is not guaranteed to run,
-// for example when the program aborts.
+// Runs after `main` or at program exit.
+// NOTE: this is not guaranteed to run, for example when the program aborts.
 #[cfg_attr(test, allow(dead_code))]
 pub fn cleanup() {
     static CLEANUP: Once = Once::new();