delegation: Track more precise spans for glob delegations#154049
delegation: Track more precise spans for glob delegations#154049petrochenkov wants to merge 4 commits intorust-lang:mainfrom
Conversation
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
6f66e76 to
1860cb7
Compare
This comment has been minimized.
This comment has been minimized.
|
ping @jackh726 it's been 3 weeks |
| // 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) } |
There was a problem hiding this comment.
Should this be a "FIXME(fn_delegation)"?
There was a problem hiding this comment.
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.
1860cb7 to
66cf18e
Compare
|
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. |
The last commit also fixes a macro hygiene issue with
selfin delegations found in #154002.