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

Allow error(transparent) inside an enum that has error("...") #366

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Nov 5, 2024

I cannot tell why this was disallowed originally. Probably just buggy implementation logic.

    error: cannot have both #[error(transparent)] and a display attribute
      --> tests/test_transparent.rs:51:5
       |
    51 |     #[error("this failed: {0}_{1}")]
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@dtolnay dtolnay merged commit 5e4b7a5 into master Nov 5, 2024
19 checks passed
@dtolnay dtolnay deleted the transparentvariant branch November 5, 2024 22:06
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.

1 participant