Document diagostic attribute duplicates#2226
Closed
mejrs wants to merge 1 commit intorust-lang:masterfrom
Closed
Conversation
mejrs
commented
Apr 13, 2026
| If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. Subsequent occurrences generates a warning. | ||
|
|
||
| r[attributes.diagnostic.on_unimplemented.duplicates] | ||
| The `diagnostic::on_unimplemented` attribute may be used any number of times. All keys from all uses of the attribute will be used and are subject to the repetition rules. |
Contributor
Author
There was a problem hiding this comment.
Existing prose looks like
The `cfg` attribute may be used any number of times on a form.
and
The `derive` attribute may be used any number of times on an item.
I'm not sure what I should use, or what a form is for that matter (it's not in the glossary).
Contributor
|
Thanks for the PR! We have an open PR at #1893 that updates this rule (among a few other things). |
Contributor
Author
|
Oh shoot, I didn't see that at all. Great minds think alike, I suppose. Would you like me to merge the linked test? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You can stack these attributes, which I think is a cool little known fact. For example:
See rust-lang/rust#155294 for the test this rule will link to.