We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#[source]
Box<dyn Error + Send + Sync>
In order to get miette (with thiserror) to render the full error chain I need to be able to add the #[source] macro onto the "source" error.
In my project I'm using a boxed error that also needs to be Send + Sync like so:
Send + Sync
#[derive(Diagnostic, Error)] struct MyError { #[error("Any Error")] #[diagnostic(transparent)] AnyError(#[source] Box<dyn Diagnostic + Send + Sync>) }
However that example fails with the following compilation error:
error[E0599]: the method `as_dyn_error` exists for reference `&Box<dyn Diagnostic + Send + Sync>`, but its trait bounds were not satisfied 20 | pub trait Diagnostic: std::error::Error { | --------------------------------------- | | | doesn't satisfy `dyn Diagnostic + Send + Sync: AsDynError<'_>` | doesn't satisfy `dyn Diagnostic + Send + Sync: Sized`
I was able to get around the issue by using an Arc instead of a Box - but I don't need any Arc features so it would be great if it worked with Box.
Arc
Box
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
In order to get miette (with thiserror) to render the full error chain I need to be able to add the
#[source]
macro onto the "source" error.In my project I'm using a boxed error that also needs to be
Send + Sync
like so:However that example fails with the following compilation error:
I was able to get around the issue by using an
Arc
instead of aBox
- but I don't need anyArc
features so it would be great if it worked withBox
.The text was updated successfully, but these errors were encountered: