Skip to content

Fix non-leaf rules with bodies - #2344

Merged
traviscross merged 10 commits into
masterfrom
TC/fix-non-leaf-rules-with-bodies
Aug 30, 2026
Merged

Fix non-leaf rules with bodies#2344
traviscross merged 10 commits into
masterfrom
TC/fix-non-leaf-rules-with-bodies

Conversation

@traviscross

Copy link
Copy Markdown
Contributor

We lint against citing non-leaf rules in tests. Consequently, we want to avoid bodies on non-leaf rules. Let's make the fixes needed to be consistent about that.

We want all body text to fall under a leaf rule.  We put intro text
under `.intro` rules, but we were missing some.  Let's add `.intro`
rule identifiers where these were missing.
In some cases, the `.intro` rule fell below a leading admonition or
example.  This left text under a non-leaf rule, which we want to
avoid.  This leading text is logically part of the introduction, so
let's move the rule identifiers where needed to cover this text.
We had rules under `items.generics.syntax` that should instead be its
siblings.  Let's promote these.
We say that macros can be declared and used locally, but we were
missing a rule identifier for this.  Let's add one.
In name resolution, we say that one way in which names introduced by
`use` declarations can be shadowed within a single scope is by macro
textual scope shadowing.  We then linked to a rule that says it's not
an error to define a macro multiple times, but that's discussing only
textual-scope matters.  A `use` declaration creates a path-based scope
binding, so let's point instead to the rule that says that textual
scope name bindings shadow path-based scope bindings.
We have a set of rules that describe how drop scopes are nested.
There's a rule that provides a lead-in for this.  That rule also
contained a claim about the drop order when multiple scopes are left
at once.  Let's break that claim out into its own rule so that we can
cite it separately.
We had combined the introduction for lint groups with a specific claim
that using a named lint group is equivalent to listing out the lints
within that group.  Let's separate out that claim into its own rule,
and let's add a `.intro` rule for the introduction.
We're missing a rule identifier above the description of the syntax
for variadic functions.  Let's add that.
Some rules that qualify other rules are identified as subrules rather
than as siblings (as they should be).  Let's fix that.
Some of the edition admonitions in the patterns chapter have rule
identifiers that mark them as subrules when they should be siblings.
Let's fix that.
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Aug 30, 2026
@traviscross traviscross removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Aug 30, 2026
@traviscross
traviscross enabled auto-merge August 30, 2026 13:36
@traviscross
traviscross added this pull request to the merge queue Aug 30, 2026
Merged via the queue into master with commit f0939b8 Aug 30, 2026
7 checks passed
@traviscross
traviscross deleted the TC/fix-non-leaf-rules-with-bodies branch August 30, 2026 13:41
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.

2 participants