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

doc: document #[diagnostic(transparent)] #266

Merged
merged 2 commits into from
Jul 16, 2023
Merged

Conversation

gavrilikhin-d
Copy link
Contributor

No description provided.

@@ -198,6 +198,18 @@
//! #[error("Oops it blew up")]
//! #[diagnostic(code(my_lib::bad_code))]
//! BadThingHappened,
//!
//! #[error(transparent)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't #[diagnostic(transparent)] imply #[error(transparent)]?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

miette is blissfully unaware of thiserror. They are completely separate macros, and miette doesn't actually do anything related to std::error::Error itself.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zkat If you're using darling (https://github.com/TedDriggs/darling) you can parse #[error] attributes and infer settings from it. This would help to avoid all the duplicate info in some cases.

@gavrilikhin-d
Copy link
Contributor Author

cargo make readme doesn't work:

$ cargo make readme
error: no such command: `make`

        Did you mean `add`?

        View all installed commands with `cargo --list`

@gavrilikhin-d gavrilikhin-d changed the title doc: Document #[diagnostic(transparent)] doc: document #[diagnostic(transparent)] May 14, 2023
@zkat
Copy link
Owner

zkat commented May 14, 2023

You need to install cargo-make first

@gavrilikhin-d
Copy link
Contributor Author

@zkat Hi! I've updated readme. Do I need to do something else to get this merged?

@zkat zkat merged commit bfacb63 into zkat:main Jul 16, 2023
@gavrilikhin-d gavrilikhin-d deleted the transparent branch July 17, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants