Allow #![doc(test(attr(..)))] everywhere#140560
Merged
bors merged 6 commits intorust-lang:masterfrom Jun 8, 2025
Merged
Conversation
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.
This PR adds the ability to specify
#![doc(test(attr(..)))]at module leveleverywhere in addition to allowing it at crate-root.This is motivated by a recent PR #140323 (by @tgross35) where we have to duplicate 2 attributes to every single
f16andf128doctests, by allowing#![doc(test(attr(..)))]at module level (and everywhere else) we can omit them entirely and just have (in both module):Those new attributes are appended to the one found at crate-root or at a previous module. Those "global" attributes are compatible with merged doctests (they already were before).
Given the small addition that this is, I'm proposing to insta-stabilize it, but I can feature-gate it if preferred.
Best reviewed commit by commit.
r? @GuillaumeGomez