Skip to content

fix(resolve): Warn on Self-Type Lifetime Elision for Non-Self Types#153692

Open
TKanX wants to merge 3 commits intorust-lang:mainfrom
TKanX:bugfix/140611-self-lifetime-elision-name-match
Open

fix(resolve): Warn on Self-Type Lifetime Elision for Non-Self Types#153692
TKanX wants to merge 3 commits intorust-lang:mainfrom
TKanX:bugfix/140611-self-lifetime-elision-name-match

Conversation

@TKanX
Copy link
Contributor

@TKanX TKanX commented Mar 11, 2026

Summary:

This PR adds an FCW lint self_lifetime_elision_not_applicable that fires when the hack actively provides a lifetime but the self parameter does not syntactically contain Self (ImplicitSelf / SelfTyParam / SelfTyAlias). A follow-up PR will remove the hack entirely after FCP.

Tracking: #140611

r? @lcnr
cc @compiler-errors @traviscross

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 11, 2026
Co-authored-by: lcnr <rust@lcnr.de>
Co-authored-by: Michael Goulet <michael@errs.io>
@TKanX TKanX force-pushed the bugfix/140611-self-lifetime-elision-name-match branch from 7f7909c to 9922812 Compare March 11, 2026 05:35
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Mar 11, 2026
@rust-log-analyzer

This comment has been minimized.

@TKanX TKanX force-pushed the bugfix/140611-self-lifetime-elision-name-match branch from ea23a3d to 7e85048 Compare March 11, 2026 07:18
@rust-log-analyzer

This comment has been minimized.

@TKanX TKanX force-pushed the bugfix/140611-self-lifetime-elision-name-match branch from 7e85048 to 7a90db6 Compare March 11, 2026 08:14
@TKanX TKanX marked this pull request as ready for review March 11, 2026 09:50
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 11, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2026

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 11, 2026
@traviscross traviscross added I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang 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.

5 participants