Skip to content

delegation: Track more precise spans for glob delegations#154049

Open
petrochenkov wants to merge 4 commits intorust-lang:mainfrom
petrochenkov:deleglobspan
Open

delegation: Track more precise spans for glob delegations#154049
petrochenkov wants to merge 4 commits intorust-lang:mainfrom
petrochenkov:deleglobspan

Conversation

@petrochenkov
Copy link
Copy Markdown
Contributor

The last commit also fixes a macro hygiene issue with self in delegations found in #154002.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 18, 2026

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 Mar 18, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 18, 2026

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 15 candidates

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@petrochenkov
Copy link
Copy Markdown
Contributor Author

ping @jackh726 it's been 3 weeks

Comment on lines +9 to +18
// impl Trait for u8 {}
// struct S(u8);

// macro_rules! self_0_ref { ($self:ident) => { &$self.0 } }

// reuse impl Trait for S { self_0_ref!(self) }

// struct M(u8);
// macro_rules! m { () => { M } }
// reuse impl Trait for m!() { self_0_ref!(self) }
Copy link
Copy Markdown
Member

@fmease fmease Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View changes since the review

Should this be a "FIXME(fn_delegation)"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was supposed to be removed, it's some remaining copypaste from tests/ui/delegation/impl-reuse-pass.rs, I missed it somehow.
Updated the test.

The span location of the last segment in the desugared path is inherited from the star symbol's span
…on body

Instead of the last segment of the delegation path.
`self` is something that introduced by the whole delegation item, not some specific part of it, and the last segment may need to have a different context for path resolution purposes.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 8, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-fn_delegation `#![feature(fn_delegation)]` 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.

4 participants