Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update backtrace formating text tips #41989

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,11 +1114,11 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) {
errors::Level::Note);
}
if match env::var_os("RUST_BACKTRACE") {
Some(val) => &val != "0",
Some(val) => (&val != "0") && (&val != "no"),
None => false,
} {
handler.emit(&MultiSpan::new(),
"run with `RUST_BACKTRACE=1` for a backtrace",
"run with `RUST_BACKTRACE=yes` for a backtrace",
errors::Level::Note);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ 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=yes` for a backtrace.");
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys_common/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub fn log_enabled() -> Option<PrintFormat> {
}

let val = match env::var_os("RUST_BACKTRACE") {
Some(x) => if &x == "0" {
Some(x) => if &x == "0" || &x == "no" {
None
} else if &x == "full" {
Some(PrintFormat::Full)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/multi-panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ 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=yes` for a backtrace."));
assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true));
assert_eq!(it.next(), None);
}
Expand Down