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

error-stack does not compile on newest nightly #873

Closed
indietyp opened this issue Jul 28, 2022 · 3 comments
Closed

error-stack does not compile on newest nightly #873

indietyp opened this issue Jul 28, 2022 · 3 comments
Labels
area/libs > error-stack Affects the `error-stack` crate (library) category/bug Something isn't working

Comments

@indietyp
Copy link
Member

Due to rust-lang/rust#96024 (comment) (rust-lang/rust#98912) the following no longer compiles:

#[cfg(all(nightly, feature = "std"))]
let backtrace = if core::any::request_ref::<Backtrace, _>(&provider)
.filter(|backtrace| backtrace.status() == BacktraceStatus::Captured)
.is_some()
{
None
} else {
Some(Backtrace::capture())
};
#[cfg(all(nightly, feature = "spantrace"))]
let span_trace = if core::any::request_ref::<SpanTrace, _>(&provider)
.filter(|span_trace| span_trace.status() == SpanTraceStatus::CAPTURED)
.is_some()
{
None
} else {
Some(SpanTrace::capture())
};

@indietyp indietyp changed the title code does not compile on newest nightly error-stack does not compile on newest nightly Jul 28, 2022
@indietyp
Copy link
Member Author

It would need to be core::any::request_ref::<Backtrace> instead.

@nonparibus nonparibus added area/libs > error-stack Affects the `error-stack` crate (library) C-bug labels Jul 28, 2022
@indietyp
Copy link
Member Author

indietyp commented Jul 28, 2022

We could adopt the new behavior or use https://github.com/dtolnay/rustversion for some conditional compilation to allow for both. This would mean we would need to add a new dependency to error-stack (not ideal)

@TimDiekmann
Copy link
Member

Fixed in dev, will be available with 0.2.0. Thanks for reporting and fixing it!

@nonparibus nonparibus added category/bug Something isn't working and removed C-bug labels Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/libs > error-stack Affects the `error-stack` crate (library) category/bug Something isn't working
Development

No branches or pull requests

3 participants