]> git.lizzy.rs Git - rust.git/commitdiff
Update panic message to be clearer about env-vars
authorDaniel Silverstone <dsilvers@digital-scurf.org>
Wed, 12 Dec 2018 14:20:49 +0000 (14:20 +0000)
committerDaniel Silverstone <dsilvers@digital-scurf.org>
Thu, 13 Dec 2018 23:07:04 +0000 (23:07 +0000)
Esteban Kuber requested that the panic message make it clear
that `RUST_BACKTRACE=1` is an environment variable.  This change
makes that clear.  Wording provided in part by David Tolnay.

src/libstd/panicking.rs
src/test/run-make-fulldeps/libtest-json/output.json
src/test/run-pass/multi-panic.rs
src/test/rustdoc-ui/failed-doctest-output.stdout

index 6b47ba6d1cb8fc56bcfcf8d0abf98275bd2cfb69..b6180fbeb506850e6554bf8f1b8d35148516c0a7 100644 (file)
@@ -209,7 +209,8 @@ fn default_hook(info: &PanicInfo) {
             if let Some(format) = log_backtrace {
                 let _ = backtrace::print(err, format);
             } else if FIRST_PANIC.compare_and_swap(true, false, Ordering::SeqCst) {
-                let _ = writeln!(err, "note: Run with `RUST_BACKTRACE=1` for a backtrace.");
+                let _ = writeln!(err, "note: Run with `RUST_BACKTRACE=1` \
+                                       environment variable to display a backtrace.");
             }
         }
     };
index 80e75c89bfc1611a2cf0d9ac1f76b71d428a3074..2b831ea2bdca4e2d9cdfe945da0c5e507a3f6f5c 100644 (file)
@@ -2,7 +2,7 @@
 { "type": "test", "event": "started", "name": "a" }
 { "type": "test", "name": "a", "event": "ok" }
 { "type": "test", "event": "started", "name": "b" }
-{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:18:5\nnote: Run with `RUST_BACKTRACE=1` for a backtrace.\n" }
+{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:18:5\nnote: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.\n" }
 { "type": "test", "event": "started", "name": "c" }
 { "type": "test", "name": "c", "event": "ok" }
 { "type": "test", "event": "started", "name": "d" }
index 2e6e10935fa7a298f6a1d5b7ac038c760ac1ab2d..03e58fc2387c74493a323eadb170c1424fe9d00e 100644 (file)
@@ -17,7 +17,8 @@ fn check_for_no_backtrace(test: std::process::Output) {
     let mut it = err.lines();
 
     assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked at")), Some(true));
-    assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` for a backtrace."));
+    assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` \
+                                environment variable to display a backtrace."));
     assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true));
     assert_eq!(it.next(), None);
 }
index cd19099647c199167ed126338856e54b79b29f2f..bd6fa1f84b468b5899ab6d78936f865d538f3c51 100644 (file)
@@ -13,13 +13,13 @@ error[E0425]: cannot find value `no` in this scope
   | ^^ not found in this scope
 
 thread '$DIR/failed-doctest-output.rs - OtherStruct (line 27)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:326:13
-note: Run with `RUST_BACKTRACE=1` for a backtrace.
+note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
 
 ---- $DIR/failed-doctest-output.rs - SomeStruct (line 21) stdout ----
 thread '$DIR/failed-doctest-output.rs - SomeStruct (line 21)' panicked at 'test executable failed:
 
 thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
-note: Run with `RUST_BACKTRACE=1` for a backtrace.
+note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
 
 ', src/librustdoc/test.rs:361:17