Skip to content

Fix attr_on_non_tail_expr typo#159208

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
nnethercote:fix-attr_on_non_tail_expr-typo
Jul 13, 2026
Merged

Fix attr_on_non_tail_expr typo#159208
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
nnethercote:fix-attr_on_non_tail_expr-typo

Conversation

@nnethercote

@nnethercote nnethercote commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a minor diagnostics bug from #117988. Details in individual commits.

r? @estebank

This demonstrates the `if cfg!(..)` suggestion being applied wrongly,
when a `cfg` attribute is followed by a non-`cfg` attribute.
The line `&& segment.ident.name == sym::cfg` duplicates a line from just
a few lines above in the same if-let chain. It's clear from context that
the `segment` is a copy/paste error and should be `next_segment`. This
fixes the erroneous suggestion given for
`multiple-tail-expr-behind-cfg.rs`.
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 13, 2026
@nnethercote nnethercote changed the title Fix attr on non tail expr typo Fix attr_on_non_tail_expr typo Jul 13, 2026
@chenyukang

Copy link
Copy Markdown
Member

@bors r=chenyukang
how do you find it 👍

@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 8955385 has been approved by chenyukang

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 13, 2026
…xpr-typo, r=chenyukang

Fix `attr_on_non_tail_expr` typo

This PR fixes a minor diagnostics bug from rust-lang#117988. Details in individual commits.

r? @estebank
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
Rollup of 11 pull requests

Successful merges:

 - #159210 (`rust-analyzer` subtree update)
 - #158655 (Fix coroutine MIR saved local remapping)
 - #159205 (bootstrap: Replace `ShouldRun::crates` with `crate_or_deps_filtered`)
 - #159208 (Fix `attr_on_non_tail_expr` typo)
 - #157524 (Fix relative paths in private import suggestions)
 - #158325 (Document NonNull layout guarantees)
 - #158882 (enable `do_not_recommend` attr for method call errors in current solver)
 - #158982 (Pretty-print MIR user types too.)
 - #159069 (Add codegen test for constant returns after local use)
 - #159163 (rustc_target: Add acquire-release to implied features of v8)
 - #159201 (borrowck: Represent 'best blame constraint' as index into `Vec<OutlivesConstraint>`)
@nnethercote

Copy link
Copy Markdown
Contributor Author

how do you find it 👍

I was reading this code while working on something else and just noticed the inconsistency.

rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
Rollup of 11 pull requests

Successful merges:

 - #159210 (`rust-analyzer` subtree update)
 - #158655 (Fix coroutine MIR saved local remapping)
 - #159205 (bootstrap: Replace `ShouldRun::crates` with `crate_or_deps_filtered`)
 - #159208 (Fix `attr_on_non_tail_expr` typo)
 - #157524 (Fix relative paths in private import suggestions)
 - #158325 (Document NonNull layout guarantees)
 - #158882 (enable `do_not_recommend` attr for method call errors in current solver)
 - #158982 (Pretty-print MIR user types too.)
 - #159069 (Add codegen test for constant returns after local use)
 - #159163 (rustc_target: Add acquire-release to implied features of v8)
 - #159201 (borrowck: Represent 'best blame constraint' as index into `Vec<OutlivesConstraint>`)
@rust-bors rust-bors Bot merged commit 7cc01ce into rust-lang:main Jul 13, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 13, 2026
rust-timer added a commit that referenced this pull request Jul 13, 2026
Rollup merge of #159208 - nnethercote:fix-attr_on_non_tail_expr-typo, r=chenyukang

Fix `attr_on_non_tail_expr` typo

This PR fixes a minor diagnostics bug from #117988. Details in individual commits.

r? @estebank
@nnethercote nnethercote deleted the fix-attr_on_non_tail_expr-typo branch July 14, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants