Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/error-chain/examples/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 457 B image not shown  

Quelle  has_backtrace.rs   Sprache: unbekannt

 
//! Exits with exit code 0 if backtraces are disabled and 1 if they are enabled.
//! Used by tests to make sure backtraces are available when they should be. Should not be used
//! outside of the tests.

#[macro_use]
extern crate error_chain;

error_chain! {
    errors {
        MyError
    }
}

fn main() {
    let err = Error::from(ErrorKind::MyError);
    let has_backtrace = err.backtrace().is_some();
    ::std::process::exit(has_backtrace as i32);
}

[ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet)  ]