Skip to content

Fix the span for parameter suggestion #158862

Open
chenyukang wants to merge 2 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-131084-self-receiver-suggestion
Open

Fix the span for parameter suggestion #158862
chenyukang wants to merge 2 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-131084-self-receiver-suggestion

Conversation

@chenyukang

@chenyukang chenyukang commented Jul 6, 2026

Copy link
Copy Markdown
Member

Fixes #131084

Previously, the recovered parameter span could point only at the inner identifier, so the suggestion was inserted after the leading &, produced a werid &&self.

The fix keeps the recovered parameter's full span on Param.span

r? @nnethercote

the second commit shows the diff of stderr.

@rustbot

rustbot commented Jul 6, 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 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

&&self suggestion from compiler

3 participants