Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework non_local_definitions lint to only use a syntactic heuristic #127117

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Jun 29, 2024

This PR reworks the non_local_definitions lint to only use a syntactic heuristic, i.e. not use a type-system logic for whenever an impl is local or not.

Instead the new logic wanted by T-lang in #126768 (comment), which is to consider every paths in Self and Trait and to no longer use the type-system inference trick.

@rustbot labels +L-non_local_definitions
Fixes #126768

@rustbot
Copy link
Collaborator

rustbot commented Jun 29, 2024

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
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

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. L-non_local_definitions Lint: non_local_definitions labels Jun 29, 2024
@BoxyUwU
Copy link
Member

BoxyUwU commented Jun 30, 2024

r? @WaffleLapkin since you reviewed the original PR

@rustbot rustbot assigned WaffleLapkin and unassigned BoxyUwU Jun 30, 2024
Copy link
Contributor

@traviscross traviscross left a comment

Choose a reason for hiding this comment

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

I looked over the tests; looks right to me.

tests/ui/lint/non-local-defs/generics.rs Show resolved Hide resolved
Copy link
Contributor

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

just typo nits

compiler/rustc_lint/src/non_local_def.rs Outdated Show resolved Hide resolved
compiler/rustc_lint/src/non_local_def.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-non_local_definitions Lint: non_local_definitions 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

non_local_definitions lint fires for impl Trait for NonLocalType<SomeLocalType>, probably shouldn't
6 participants