-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
anyhow's dyn error backtrace
disagrees with anyhow::Error::backtrace
#231
Comments
bactrace
disagrees withbactrace
disagrees with anyhow::Error::backtrace
bactrace
disagrees with anyhow::Error::backtrace
bacltrace
disagrees with anyhow::Error::backtrace
bacltrace
disagrees with anyhow::Error::backtrace
backtrace
disagrees with anyhow::Error::backtrace
Updated repro: #![feature(error_generic_member_access, provide_any)]
use std::any;
use std::backtrace::Backtrace;
use std::ops::Deref;
use thiserror::Error;
#[derive(Error, Debug)]
enum Gus {
#[error("hmm")]
Other(
#[from]
#[backtrace]
anyhow::Error,
),
}
fn main() {
println!("{:?}", Gus::from(anyhow::anyhow!("main")));
println!("{:?}", any::request_ref::<Backtrace>(&Gus::from(anyhow::anyhow!("main"))));
println!("{:?}", any::request_ref::<Backtrace>(&anyhow::anyhow!("main").deref()));
} Other(main
Stack backtrace:
…)
None
None |
This is fixed as of thiserror 1.0.34 and anyhow 1.0.64. Other(main
Stack backtrace:
…)
Some(Backtrace […])
None The last one is still |
results in
Looking briefly at the code, this appears to be at least semi-on-purpose, where the vtable for adhoc errors points to
no_backtrace
, but it links the backtrace back in somehow? can theErrorImpl
coercion do the same things asanyhow/src/error.rs
Line 880 in 6833150
(also, is there a reason the backtrace is only printed for the
Debug
impl, not theDisplay
impl, should the docs be updated to reflect that?)The text was updated successfully, but these errors were encountered: