-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
forward() attribute undocumented #320
Labels
Comments
After some digging in the codebase, it seems like #[derive(miette::Diagnostic, thiserror::Error, Debug)]
#[diagnostic(url("http://mylib.example"))]
enum Error {
#[error(transparent)]
#[diagnostic(forward(0)]
External(#[from] external::Error),
}
mod external {
#[derive(miette::Diagnostic, thiserror::Error, Debug)]
#[error("external error")]
pub struct Error;
} |
zkat
added
documentation
Improvements or additions to documentation
help wanted
Extra attention is needed
labels
Feb 4, 2024
zkat
changed the title
Cannot use transparent with global attributes
forward() attribute undocumented
Feb 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
It seems like you cannot mix
transparent
with any enum-level attributes, eg:results in
error: diagnostic(transparent) not allowed in combination with other args
I believe that I understand how this error is coming to pass, but in my case of having my library split among multiple crates, and my error enums being quite long it seems like too much to replicate the enum-level attributes for all other variants.
In this case, I think it would be reasonable to ignore the enum-level attributes for any variant that uses
transparent
, or maybe there's some alternate syntax or feature that I am missing for this case?The text was updated successfully, but these errors were encountered: