Merge pull request #92 from asonix/asonix/update-tracing-error

Update tracing error (and tracing subscriber)
This commit is contained in:
Jane Lusby 2022-01-12 16:26:47 -08:00 committed by GitHub
commit 5624f10c50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 159 additions and 154 deletions

View File

@ -19,20 +19,20 @@ track-caller = []
[dependencies]
eyre = "0.6.1"
tracing-error = { version = "0.1.2", optional = true }
tracing-error = { version = "0.2.0", optional = true }
backtrace = { version = "0.3.48", features = ["gimli-symbolize"] }
indenter = "0.3.0"
owo-colors = "1.2.1"
color-spantrace = { version = "0.1.6", optional = true }
owo-colors = "3.2.0"
color-spantrace = { version = "0.2", optional = true }
once_cell = "1.4.0"
url = { version = "2.1.1", optional = true }
[dev-dependencies]
tracing-subscriber = "0.2.5"
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
tracing = "0.1.13"
pretty_assertions = "0.6.1"
pretty_assertions = "1.0.0"
thiserror = "1.0.19"
ansi-parser = "0.6.5" # used for testing color schemes
ansi-parser = "0.8.0"
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3.15"

View File

@ -26,7 +26,7 @@ fn main() -> Result<(), Report> {
.install()
.unwrap();
Ok(read_config()?)
read_config()
}
#[cfg(feature = "capture-spantrace")]

View File

@ -34,7 +34,7 @@ fn main() -> Result<(), Report> {
install_tracing();
color_eyre::install()?;
Ok(read_config().map(drop)?)
read_config().map(drop)
}
#[cfg(feature = "capture-spantrace")]

View File

@ -34,7 +34,7 @@ fn main() {
let span = tracing::info_span!("get_error", msg);
let _guard = span.enter();
let error = get_error(msg);
panic!(error)
std::panic::panic_any(error)
}
fn setup() {

View File

@ -8,7 +8,7 @@ fn main() -> Result<(), Report> {
color_eyre::install()?;
Ok(read_config()?)
read_config()
}
#[cfg(feature = "capture-spantrace")]

View File

@ -257,7 +257,7 @@ impl<'a> fmt::Display for StyledFrame<'a> {
// Maybe print source.
if v >= Verbosity::Full {
write!(&mut separated.ready(), "{}", SourceSection(&frame, *theme))?;
write!(&mut separated.ready(), "{}", SourceSection(frame, *theme))?;
}
Ok(())
@ -859,7 +859,7 @@ fn print_panic_info(report: &PanicReport<'_>, f: &mut fmt::Formatter<'_>) -> fmt
}
if let Some(bt) = report.backtrace.as_ref() {
let fmted_bt = report.hook.format_backtrace(&bt);
let fmted_bt = report.hook.format_backtrace(bt);
write!(
indented(&mut separated.ready()).with_format(Format::Uniform { indentation: " " }),
"{}",

View File

@ -112,7 +112,7 @@ impl eyre::EyreHandler for Handler {
}
if let Some(backtrace) = self.backtrace.as_ref() {
let fmted_bt = self.format_backtrace(&backtrace);
let fmted_bt = self.format_backtrace(backtrace);
write!(
indented(&mut separated.ready()).with_format(Format::Uniform { indentation: " " }),

View File

@ -338,7 +338,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(
missing_docs,
missing_doc_code_examples,
rustdoc::missing_doc_code_examples,
rust_2018_idioms,
unreachable_pub,
bad_style,

View File

@ -2,49 +2,49 @@
0: test
Location:
tests/theme.rs:1
tests/theme.rs:17
Error:
0: error
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0: theme::get_error with msg="test"
0: theme::get_error with msg="test"
at tests/theme.rs:11
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ⋮ 5 frames hidden ⋮ 
6: theme::get_error::create_report::h982c27931cc8e4b1
at <unknown source file>:<unknown line>
7: theme::get_error::{{closure}}::hae775e99e0b7d1c5
at <unknown source file>:<unknown line>
8: core::option::Option<T>::ok_or_else::hd4b57a8cb5c1870b
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:558
9: theme::get_error::hfc71373d92f563f0
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:1
10: theme::test_error_backwards_compatibility::h4bf087e5e689a5d0
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:36
11: theme::test_error_backwards_compatibility::{{closure}}::hf172868901d86cb0
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:34
12: core::ops::function::FnOnce::call_once::h9b87751ef643fe90
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::hb2ff33e91aac5799
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::hc8fd71b19bc78390
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:516
15: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hb8ab4b7e0de41b66
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042
16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hc48829c2ba8b55d6
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:308
17: std::panicking::try::do_call::h95feedb4d9e8dd5b
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381
18: std::panicking::try::hc4c23f5f7d3bdd43
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345
19: std::panic::catch_unwind::hf3a57d903cc5007a
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382
20: test::run_test_in_process::h09c598ed2a1f6695
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:543
 ⋮ 14 frames hidden ⋮ 
6: theme::get_error::create_report::hdb41452bef3fc05d
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:17
7: theme::get_error::{{closure}}::h739c7fe800e2d03f
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
8: core::option::Option<T>::ok_or_else::hd8e670bbca63e94a
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:954
9: theme::get_error::h2f751f4927c6fecb
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
10: theme::test_error_backwards_compatibility::hfc4be9f22c32535c
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:43
11: theme::test_error_backwards_compatibility::{{closure}}::hb001a9a908f0f5a4
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:41
12: core::ops::function::FnOnce::call_once::he26938a69d361bf6
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::h83cc023b85256d97
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::h7330e4e8b0549e26
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:585
15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6b77566b8f386abb
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691
16: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h2ad5de64df41b71c
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panic/unwind_safe.rs:271
17: std::panicking::try::do_call::he67b1e56b423a618
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:403
18: std::panicking::try::ha9224adcdd41a723
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:367
19: std::panic::catch_unwind::h9111b58ae0b27828
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:133
20: test::run_test_in_process::h15b6b7d5919893aa
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:608
 ⋮ 15 frames hidden ⋮ 
Note: note
Warning: warning

View File

@ -2,44 +2,44 @@
0: test
Location:
tests/theme.rs:1
tests/theme.rs:17
Error:
0: error
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ⋮ 5 frames hidden ⋮ 
6: theme::get_error::create_report::hecce092abf39d046
at <unknown source file>:<unknown line>
7: theme::get_error::{{closure}}::h72d386b2dea32911
at <unknown source file>:<unknown line>
8: core::option::Option<T>::ok_or_else::h21963800b101550e
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:558
9: theme::get_error::hd9136d29f5ab726a
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:1
10: theme::test_error_backwards_compatibility::h34861d848c30c15b
6: theme::get_error::create_report::hf800a973f2100b44
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:17
7: theme::get_error::{{closure}}::ha65156cf9648d3e0
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
8: core::option::Option<T>::ok_or_else::h08df66cff4c7bff2
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:954
9: theme::get_error::h7c1fce8fa3550ff9
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
10: theme::test_error_backwards_compatibility::h732311d7da5d7160
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:43
11: theme::test_error_backwards_compatibility::{{closure}}::h807eb4bfe3d5b701
11: theme::test_error_backwards_compatibility::{{closure}}::h144cea82038adfc7
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:41
12: core::ops::function::FnOnce::call_once::h367eeeae05a22ee2
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::hb2ff33e91aac5799
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::hc8fd71b19bc78390
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:516
15: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hb8ab4b7e0de41b66
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042
16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hc48829c2ba8b55d6
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:308
17: std::panicking::try::do_call::h95feedb4d9e8dd5b
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381
18: std::panicking::try::hc4c23f5f7d3bdd43
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345
19: std::panic::catch_unwind::hf3a57d903cc5007a
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382
20: test::run_test_in_process::h09c598ed2a1f6695
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:543
 ⋮ 14 frames hidden ⋮ 
12: core::ops::function::FnOnce::call_once::h8d0ee3b0b70ed418
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::h83cc023b85256d97
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::h7330e4e8b0549e26
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:585
15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6b77566b8f386abb
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691
16: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h2ad5de64df41b71c
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panic/unwind_safe.rs:271
17: std::panicking::try::do_call::he67b1e56b423a618
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:403
18: std::panicking::try::ha9224adcdd41a723
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:367
19: std::panic::catch_unwind::h9111b58ae0b27828
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:133
20: test::run_test_in_process::h15b6b7d5919893aa
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:608
 ⋮ 15 frames hidden ⋮ 
Note: note
Warning: warning

View File

@ -6,37 +6,37 @@ Error:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ⋮ 5 frames hidden ⋮ 
6: theme::get_error::create_report::h0e145b5457fc8cad
at <unknown source file>:<unknown line>
7: theme::get_error::{{closure}}::hb27e60e10fce9219
at <unknown source file>:<unknown line>
8: core::option::Option<T>::ok_or_else::h20663e177c22f833
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:558
9: theme::get_error::h9c9e66e0ceed2b65
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:1
10: theme::test_error_backwards_compatibility::h9e815269077c9440
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:73
11: theme::test_error_backwards_compatibility::{{closure}}::h046022f112557a9a
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:71
12: core::ops::function::FnOnce::call_once::hc5e0c046d81e0b54
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::hb2ff33e91aac5799
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::hc8fd71b19bc78390
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:516
15: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hb8ab4b7e0de41b66
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042
16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hc48829c2ba8b55d6
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:308
17: std::panicking::try::do_call::h95feedb4d9e8dd5b
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381
18: std::panicking::try::hc4c23f5f7d3bdd43
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345
19: std::panic::catch_unwind::hf3a57d903cc5007a
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382
20: test::run_test_in_process::h09c598ed2a1f6695
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:543
 ⋮ 14 frames hidden ⋮ 
6: theme::get_error::create_report::h89d883b51d51a08b
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:17
7: theme::get_error::{{closure}}::hb62079fda66513a2
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
8: core::option::Option<T>::ok_or_else::h3227505b8a14ed22
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:954
9: theme::get_error::hd930d722dbdb6279
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
10: theme::test_error_backwards_compatibility::h920cc312bf19dc01
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:43
11: theme::test_error_backwards_compatibility::{{closure}}::h0c00291bcfdb63ce
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:41
12: core::ops::function::FnOnce::call_once::h7736c3dcb6fd829d
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::h83cc023b85256d97
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::h7330e4e8b0549e26
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:585
15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6b77566b8f386abb
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691
16: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h2ad5de64df41b71c
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panic/unwind_safe.rs:271
17: std::panicking::try::do_call::he67b1e56b423a618
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:403
18: std::panicking::try::ha9224adcdd41a723
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:367
19: std::panic::catch_unwind::h9111b58ae0b27828
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:133
20: test::run_test_in_process::h15b6b7d5919893aa
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:608
 ⋮ 15 frames hidden ⋮ 
Note: note
Warning: warning

View File

@ -5,43 +5,43 @@ Error:
0: error
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0: theme::get_error with msg="test"
0: theme::get_error with msg="test"
at tests/theme.rs:11
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ⋮ 5 frames hidden ⋮ 
6: theme::get_error::create_report::hbcd472d1eeaf19a1
at <unknown source file>:<unknown line>
7: theme::get_error::{{closure}}::h45c5fb3ac686eba0
at <unknown source file>:<unknown line>
8: core::option::Option<T>::ok_or_else::h0e862254360788fc
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:558
9: theme::get_error::haec25813a54aac8c
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:1
10: theme::test_error_backwards_compatibility::h45e601b75f8f5192
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:73
11: theme::test_error_backwards_compatibility::{{closure}}::h872ad148b26640d2
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:71
12: core::ops::function::FnOnce::call_once::h4773fdcbabed93bc
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::hb2ff33e91aac5799
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::hc8fd71b19bc78390
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:516
15: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hb8ab4b7e0de41b66
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042
16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hc48829c2ba8b55d6
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:308
17: std::panicking::try::do_call::h95feedb4d9e8dd5b
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381
18: std::panicking::try::hc4c23f5f7d3bdd43
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345
19: std::panic::catch_unwind::hf3a57d903cc5007a
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382
20: test::run_test_in_process::h09c598ed2a1f6695
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/test/src/lib.rs:543
 ⋮ 14 frames hidden ⋮ 
6: theme::get_error::create_report::h4bc625c000e4636e
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:17
7: theme::get_error::{{closure}}::h3dee499015f52230
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
8: core::option::Option<T>::ok_or_else::h32a80642d5f9cd65
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:954
9: theme::get_error::hb3756d9f0d65527f
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:25
10: theme::test_error_backwards_compatibility::h69192dd92f3a8a2e
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:43
11: theme::test_error_backwards_compatibility::{{closure}}::hd9459c2e516ade18
at /home/jlusby/git/yaahc/color-eyre/tests/theme.rs:41
12: core::ops::function::FnOnce::call_once::h540507413fe72275
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
13: core::ops::function::FnOnce::call_once::h83cc023b85256d97
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
14: test::__rust_begin_short_backtrace::h7330e4e8b0549e26
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:585
15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6b77566b8f386abb
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691
16: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h2ad5de64df41b71c
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panic/unwind_safe.rs:271
17: std::panicking::try::do_call::he67b1e56b423a618
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:403
18: std::panicking::try::ha9224adcdd41a723
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:367
19: std::panic::catch_unwind::h9111b58ae0b27828
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:133
20: test::run_test_in_process::h15b6b7d5919893aa
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/test/src/lib.rs:608
 ⋮ 15 frames hidden ⋮ 
Note: note
Warning: warning

View File

@ -5,17 +5,19 @@ Message: <non string panic payload>
Location: examples/theme_test_helper.rs:37
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0: theme_test_helper::get_error with msg="test"
0: theme_test_helper::get_error with msg="test"
at examples/theme_test_helper.rs:34
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ⋮ 6 frames hidden ⋮ 
7: theme_test_helper::main::h0f7f307e00efc098
7: std::panic::panic_any::hd76a7f826307234c
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:57
8: theme_test_helper::main::h767d3fd6c45048c8
at /home/jlusby/git/yaahc/color-eyre/examples/theme_test_helper.rs:37
8: core::ops::function::FnOnce::call_once::hc90fd75bf8c9f979
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
 ⋮ 11 frames hidden ⋮ 
9: core::ops::function::FnOnce::call_once::hc5a1cd4127189dad
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
 ⋮ 15 frames hidden ⋮ 
Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

View File

@ -1,4 +1,4 @@
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
Running `target/debug/examples/theme_test_helper`
The application panicked (crashed).
Message: <non string panic payload>
@ -6,11 +6,13 @@ Location: examples/theme_test_helper.rs:37
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ⋮ 6 frames hidden ⋮ 
7: theme_test_helper::main::hf2cd59a3917c7d01
7: std::panic::panic_any::hb5351c0843c6c4aa
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:57
8: theme_test_helper::main::h22b568e997946766
at /home/jlusby/git/yaahc/color-eyre/examples/theme_test_helper.rs:37
8: core::ops::function::FnOnce::call_once::h1469d0953292aa83
at /home/jlusby/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
 ⋮ 11 frames hidden ⋮ 
9: core::ops::function::FnOnce::call_once::hab7662216a7cf3dc
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227
 ⋮ 15 frames hidden ⋮ 
Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

View File

@ -100,6 +100,7 @@ static PANIC_FILE_NAME: &str = "theme_panic_control.txt";
// The following tests the installed panic handler
#[test]
#[allow(unused_mut)]
#[allow(clippy::vec_init_then_push)]
fn test_panic_backwards_compatibility() {
let mut features: Vec<&str> = vec![];
#[cfg(feature = "capture-spantrace")]
@ -160,7 +161,7 @@ fn test_backwards_compatibility(target: String, file_name: &str) {
})
.collect();
(all, ansi)
};
}
let (_control_tokens, control_ansi) = f(&control);
let (_target_tokens, target_ansi) = f(&target);