Fix non-leaf rules with bodies - #2344
Merged
Merged
Conversation
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.
traviscross
enabled auto-merge
August 30, 2026 13:36
This was referenced Aug 30, 2026
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.
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.