Skip to content
Myr

Remove stack backtrace disabled notice

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This message ended up being too noisy. Applications that want to print a notice like this can print it themselves.

authored by David Tolnay · committed by David Tolnay · parent 1790576 · Browse files · 2 files+6 added−24 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−24 removed

  • tests:+0 added−9 removed
  • other:+6 added−15 removed

2 files+6 added−24 removed

modified:src/fmt.rs+6 added-15 removed
36 unmodified lines
37 {38 use std::backtrace::BacktraceStatus;3940 let backtrace = self.backtrace();41 match backtrace.status() {42 BacktraceStatus::Captured => {43 let mut backtrace = backtrace.to_string();44 if backtrace.starts_with("stack backtrace:") {45 // Capitalize to match "Caused by:"46 backtrace.replace_range(0..1, "S");41 if let BacktraceStatus::Captured = backtrace.status() {42 let mut backtrace = backtrace.to_string();43 if backtrace.starts_with("stack backtrace:") {44 // Capitalize to match "Caused by:"45 backtrace.replace_range(0..1, "S");47 }48 write!(f, "\n{}", backtrace)?;46 }50 BacktraceStatus::Disabled => {51 writeln!(52 f,53 "\nStack backtrace:\n Run with RUST_LIB_BACKTRACE=1 env variable to display a backtrace"54 )?;55 }56 _ => {}47 write!(f, "\n{}", backtrace)?;48 }49 }5051 Ok(())
2 unmodified lines
modified:tests/test_fmt.rs-9 removed
19 unmodified lines
20const EXPECTED_ALTDISPLAY_H: &str = "g failed: f failed: oh no!";2122const EXPECTED_DEBUG_F: &str = "\23oh no!2425Stack backtrace:26 Run with RUST_LIB_BACKTRACE=1 env variable to display a backtrace24";2526const EXPECTED_DEBUG_G: &str = "\27f failed2829Caused by:30 oh no!3435Stack backtrace:36 Run with RUST_LIB_BACKTRACE=1 env variable to display a backtrace31";3233const EXPECTED_DEBUG_H: &str = "\34g failed3536Caused by:37 0: f failed38 1: oh no!4546Stack backtrace:47 Run with RUST_LIB_BACKTRACE=1 env variable to display a backtrace39";4041const EXPECTED_ALTDEBUG_F: &str = "\42Custom {
54 unmodified lines