Skip to content

Demoting completion relevance when an inherent impl already exists#22031

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
WeiTheShinobi:introduce_has_local_inherent_impl_on_render
Apr 13, 2026
Merged

Demoting completion relevance when an inherent impl already exists#22031
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
WeiTheShinobi:introduce_has_local_inherent_impl_on_render

Conversation

@WeiTheShinobi
Copy link
Copy Markdown
Contributor

@WeiTheShinobi WeiTheShinobi commented Apr 13, 2026

Fixed #13197

Added a new field has_local_inherent_impl to CompletionRelevance for demoting completion relevance when an inherent impl already exists.

My first contribution to this project. Thanks for the review!

Example

Case

trait Foob {}
struct Fooa {}
impl Fooa {}

impl Foo$0

Before

st Fooa Fooa []
tt Foob  []

After

tt Foob  []
st Fooa Fooa [has_local_inherent_impl]

About CompletionRelevance:

if has_local_inherent_impl {
        score -= 5;
}

Not sure if score -= 5 is good or not?

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 13, 2026
Merged via the queue into rust-lang:master with commit 8e2d2ad Apr 13, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 13, 2026
@WeiTheShinobi WeiTheShinobi deleted the introduce_has_local_inherent_impl_on_render branch April 13, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prefer completing impl T[rait] for over impl T[ype] when an inherent impl already exists

3 participants