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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 8, 2026
Update books

## rust-lang/book

1 commits in 917544888a55e4da7109bdba8c88c893c0da70f4..1500248d8f230566e4ec9f27fcbb8fe9e2898ab1
2026-09-02 16:04:34 UTC to 2026-09-02 16:04:34 UTC

- Update to Rust 1.98 (rust-lang/book#4823)

## rust-lang/edition-guide

1 commits in f5abcf137698e5ad6ebed359d69654ff705346af..ab8544aeed7b792984366aa122ac19bd47ad9a2f
2026-08-25 19:50:54 UTC to 2026-08-25 19:50:54 UTC

- Update never-type-fallback for never type stabilization (rust-lang/edition-guide#384)

## rust-lang/reference

12 commits in 3b38834b39f732c64686f7c64aa29dcf3cd83ba5..e24eecf97b0c9a6dbac67191098204dc8a190aaa
2026-09-02 04:25:27 UTC to 2026-08-25 07:52:18 UTC

- Fix nested block comment grammar (rust-lang/reference#2348)
- dangling pointers: turn some consequences of the definition into notes (rust-lang/reference#2336)
- Fix the nightly grammar validation job (rust-lang/reference#2347)
- Order grammar summary deterministically (rust-lang/reference#2346)
- Remove leftover `types/textual.md` file (rust-lang/reference#2345)
- Fix non-leaf rules with bodies (rust-lang/reference#2344)
- Fix rule IDs not following the header hierarchy (rust-lang/reference#2343)
- Fix heading level of the `verbatim` modifier section (rust-lang/reference#2342)
- Fix `...diagnostics.deprecated...` rule ID (rust-lang/reference#2341)
- Update for stabilization of the never type (rust-lang/reference#2283)
- Add missing punctuation (rust-lang/reference#2339)
- Fix field-less `repr(C)` enum docs (rust-lang/reference#2018)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 8, 2026
Update books

## rust-lang/book

1 commits in 917544888a55e4da7109bdba8c88c893c0da70f4..1500248d8f230566e4ec9f27fcbb8fe9e2898ab1
2026-09-02 16:04:34 UTC to 2026-09-02 16:04:34 UTC

- Update to Rust 1.98 (rust-lang/book#4823)

## rust-lang/edition-guide

1 commits in f5abcf137698e5ad6ebed359d69654ff705346af..ab8544aeed7b792984366aa122ac19bd47ad9a2f
2026-08-25 19:50:54 UTC to 2026-08-25 19:50:54 UTC

- Update never-type-fallback for never type stabilization (rust-lang/edition-guide#384)

## rust-lang/reference

12 commits in 3b38834b39f732c64686f7c64aa29dcf3cd83ba5..e24eecf97b0c9a6dbac67191098204dc8a190aaa
2026-09-02 04:25:27 UTC to 2026-08-25 07:52:18 UTC

- Fix nested block comment grammar (rust-lang/reference#2348)
- dangling pointers: turn some consequences of the definition into notes (rust-lang/reference#2336)
- Fix the nightly grammar validation job (rust-lang/reference#2347)
- Order grammar summary deterministically (rust-lang/reference#2346)
- Remove leftover `types/textual.md` file (rust-lang/reference#2345)
- Fix non-leaf rules with bodies (rust-lang/reference#2344)
- Fix rule IDs not following the header hierarchy (rust-lang/reference#2343)
- Fix heading level of the `verbatim` modifier section (rust-lang/reference#2342)
- Fix `...diagnostics.deprecated...` rule ID (rust-lang/reference#2341)
- Update for stabilization of the never type (rust-lang/reference#2283)
- Add missing punctuation (rust-lang/reference#2339)
- Fix field-less `repr(C)` enum docs (rust-lang/reference#2018)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 8, 2026
Update books

## rust-lang/book

1 commits in 917544888a55e4da7109bdba8c88c893c0da70f4..1500248d8f230566e4ec9f27fcbb8fe9e2898ab1
2026-09-02 16:04:34 UTC to 2026-09-02 16:04:34 UTC

- Update to Rust 1.98 (rust-lang/book#4823)

## rust-lang/edition-guide

1 commits in f5abcf137698e5ad6ebed359d69654ff705346af..ab8544aeed7b792984366aa122ac19bd47ad9a2f
2026-08-25 19:50:54 UTC to 2026-08-25 19:50:54 UTC

- Update never-type-fallback for never type stabilization (rust-lang/edition-guide#384)

## rust-lang/reference

12 commits in 3b38834b39f732c64686f7c64aa29dcf3cd83ba5..e24eecf97b0c9a6dbac67191098204dc8a190aaa
2026-09-02 04:25:27 UTC to 2026-08-25 07:52:18 UTC

- Fix nested block comment grammar (rust-lang/reference#2348)
- dangling pointers: turn some consequences of the definition into notes (rust-lang/reference#2336)
- Fix the nightly grammar validation job (rust-lang/reference#2347)
- Order grammar summary deterministically (rust-lang/reference#2346)
- Remove leftover `types/textual.md` file (rust-lang/reference#2345)
- Fix non-leaf rules with bodies (rust-lang/reference#2344)
- Fix rule IDs not following the header hierarchy (rust-lang/reference#2343)
- Fix heading level of the `verbatim` modifier section (rust-lang/reference#2342)
- Fix `...diagnostics.deprecated...` rule ID (rust-lang/reference#2341)
- Update for stabilization of the never type (rust-lang/reference#2283)
- Add missing punctuation (rust-lang/reference#2339)
- Fix field-less `repr(C)` enum docs (rust-lang/reference#2018)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 8, 2026
Update books

## rust-lang/book

1 commits in 917544888a55e4da7109bdba8c88c893c0da70f4..1500248d8f230566e4ec9f27fcbb8fe9e2898ab1
2026-09-02 16:04:34 UTC to 2026-09-02 16:04:34 UTC

- Update to Rust 1.98 (rust-lang/book#4823)

## rust-lang/edition-guide

1 commits in f5abcf137698e5ad6ebed359d69654ff705346af..ab8544aeed7b792984366aa122ac19bd47ad9a2f
2026-08-25 19:50:54 UTC to 2026-08-25 19:50:54 UTC

- Update never-type-fallback for never type stabilization (rust-lang/edition-guide#384)

## rust-lang/reference

12 commits in 3b38834b39f732c64686f7c64aa29dcf3cd83ba5..e24eecf97b0c9a6dbac67191098204dc8a190aaa
2026-09-02 04:25:27 UTC to 2026-08-25 07:52:18 UTC

- Fix nested block comment grammar (rust-lang/reference#2348)
- dangling pointers: turn some consequences of the definition into notes (rust-lang/reference#2336)
- Fix the nightly grammar validation job (rust-lang/reference#2347)
- Order grammar summary deterministically (rust-lang/reference#2346)
- Remove leftover `types/textual.md` file (rust-lang/reference#2345)
- Fix non-leaf rules with bodies (rust-lang/reference#2344)
- Fix rule IDs not following the header hierarchy (rust-lang/reference#2343)
- Fix heading level of the `verbatim` modifier section (rust-lang/reference#2342)
- Fix `...diagnostics.deprecated...` rule ID (rust-lang/reference#2341)
- Update for stabilization of the never type (rust-lang/reference#2283)
- Add missing punctuation (rust-lang/reference#2339)
- Fix field-less `repr(C)` enum docs (rust-lang/reference#2018)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 8, 2026
Update books

## rust-lang/book

1 commits in 917544888a55e4da7109bdba8c88c893c0da70f4..1500248d8f230566e4ec9f27fcbb8fe9e2898ab1
2026-09-02 16:04:34 UTC to 2026-09-02 16:04:34 UTC

- Update to Rust 1.98 (rust-lang/book#4823)

## rust-lang/edition-guide

1 commits in f5abcf137698e5ad6ebed359d69654ff705346af..ab8544aeed7b792984366aa122ac19bd47ad9a2f
2026-08-25 19:50:54 UTC to 2026-08-25 19:50:54 UTC

- Update never-type-fallback for never type stabilization (rust-lang/edition-guide#384)

## rust-lang/reference

12 commits in 3b38834b39f732c64686f7c64aa29dcf3cd83ba5..e24eecf97b0c9a6dbac67191098204dc8a190aaa
2026-09-02 04:25:27 UTC to 2026-08-25 07:52:18 UTC

- Fix nested block comment grammar (rust-lang/reference#2348)
- dangling pointers: turn some consequences of the definition into notes (rust-lang/reference#2336)
- Fix the nightly grammar validation job (rust-lang/reference#2347)
- Order grammar summary deterministically (rust-lang/reference#2346)
- Remove leftover `types/textual.md` file (rust-lang/reference#2345)
- Fix non-leaf rules with bodies (rust-lang/reference#2344)
- Fix rule IDs not following the header hierarchy (rust-lang/reference#2343)
- Fix heading level of the `verbatim` modifier section (rust-lang/reference#2342)
- Fix `...diagnostics.deprecated...` rule ID (rust-lang/reference#2341)
- Update for stabilization of the never type (rust-lang/reference#2283)
- Add missing punctuation (rust-lang/reference#2339)
- Fix field-less `repr(C)` enum docs (rust-lang/reference#2018)
@rustbot rustbot added this to the 1.100.0 milestone Sep 8, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Sep 8, 2026
Rollup merge of #162439 - rustbot:docs-update, r=traviscross

Update books

## rust-lang/book

1 commits in 917544888a55e4da7109bdba8c88c893c0da70f4..1500248d8f230566e4ec9f27fcbb8fe9e2898ab1
2026-09-02 16:04:34 UTC to 2026-09-02 16:04:34 UTC

- Update to Rust 1.98 (rust-lang/book#4823)

## rust-lang/edition-guide

1 commits in f5abcf137698e5ad6ebed359d69654ff705346af..ab8544aeed7b792984366aa122ac19bd47ad9a2f
2026-08-25 19:50:54 UTC to 2026-08-25 19:50:54 UTC

- Update never-type-fallback for never type stabilization (rust-lang/edition-guide#384)

## rust-lang/reference

12 commits in 3b38834b39f732c64686f7c64aa29dcf3cd83ba5..e24eecf97b0c9a6dbac67191098204dc8a190aaa
2026-09-02 04:25:27 UTC to 2026-08-25 07:52:18 UTC

- Fix nested block comment grammar (rust-lang/reference#2348)
- dangling pointers: turn some consequences of the definition into notes (rust-lang/reference#2336)
- Fix the nightly grammar validation job (rust-lang/reference#2347)
- Order grammar summary deterministically (rust-lang/reference#2346)
- Remove leftover `types/textual.md` file (rust-lang/reference#2345)
- Fix non-leaf rules with bodies (rust-lang/reference#2344)
- Fix rule IDs not following the header hierarchy (rust-lang/reference#2343)
- Fix heading level of the `verbatim` modifier section (rust-lang/reference#2342)
- Fix `...diagnostics.deprecated...` rule ID (rust-lang/reference#2341)
- Update for stabilization of the never type (rust-lang/reference#2283)
- Add missing punctuation (rust-lang/reference#2339)
- Fix field-less `repr(C)` enum docs (rust-lang/reference#2018)
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