about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-11-26 09:27:11 +0100
committerRalf Jung <post@ralfj.de>2019-11-26 09:27:11 +0100
commit61486f4de3b5e04f401a4da2edae2fc4c9f02bc7 (patch)
tree0293d0731334cd11cdd98198f376eee78f431ea6 /src/libstd
parent3e96ca2bf7f7c558623e372e7a9800ac752faa9c (diff)
downloadrust-61486f4de3b5e04f401a4da2edae2fc4c9f02bc7.tar.gz
rust-61486f4de3b5e04f401a4da2edae2fc4c9f02bc7.zip
expand comment
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/panicking.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs
index 5ba5d89bb63..8f9a4c05b57 100644
--- a/src/libstd/panicking.rs
+++ b/src/libstd/panicking.rs
@@ -457,11 +457,12 @@ fn rust_panic_with_hook(payload: &mut dyn BoxMeUp,
         let mut info = PanicInfo::internal_constructor(message, &location);
         HOOK_LOCK.read();
         match HOOK {
-            // Some platforms know that printing to stderr won't ever actually
+            // Some platforms (like wasm) know that printing to stderr won't ever actually
             // print anything, and if that's the case we can skip the default
             // hook. Since string formatting happens lazily when calling `payload`
-            // methods, this means that with libpanic_abort, we don't format
-            // the string at all!
+            // methods, this means we avoid formatting the string at all!
+            // (The panic runtime might still call `payload.take_box()` though and trigger
+            // formatting.)
             Hook::Default if panic_output().is_none() => {}
             Hook::Default => {
                 info.set_payload(payload.get());