Skip to content

feat: Diagnose trait errors 🎉#22186

Merged
ChayimFriedman2 merged 3 commits into
rust-lang:masterfrom
ChayimFriedman2:trait-errors
May 3, 2026
Merged

feat: Diagnose trait errors 🎉#22186
ChayimFriedman2 merged 3 commits into
rust-lang:masterfrom
ChayimFriedman2:trait-errors

Conversation

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

I.e. type does not implement trait.

There are a lot of other solver errors to be emitted, and the error is pretty simple currently, but this is a huge step!

Watch this wonderful video:

trait.errors.mp4

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2026
@rustbot

This comment has been minimized.

@ChayimFriedman2 ChayimFriedman2 force-pushed the trait-errors branch 2 times, most recently from 5939ef1 to 73dce3f Compare April 28, 2026 17:46
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

In rustc it is not, but we're unlikely to add something non-`Copy` to it in the near future, and it simplifies the code.

This was basically adding a derive then `cargo clippy --fix` and `cargo fmt`.
I.e. type does not implement trait.

There are a lot of other solver errors to be emitted, and the error is pretty simple currently, but this is a huge step!
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 2, 2026

This PR was rebased onto a different master 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.

Copy link
Copy Markdown
Member

@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

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

Really exciting, huge progress 🎉
I'm quite sure the implementation is done right, but I delegate the merge at your disposal as you might want second eyes for this or this might cause some false positives so might be a little bit overwhelming to be merged just before the stable release 😅

View changes since this review

}
"#,
expect![[r#"
46..49 'Foo': Foo<N>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this should be a severe regression/blocker but just out of curiosity, do you happen to know what makes this change?

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.

Hmm, no. Weird 😕

@ChayimFriedman2
Copy link
Copy Markdown
Contributor Author

The diagnostic is experimental, so false positives are ~fine.

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue May 3, 2026
Merged via the queue into rust-lang:master with commit 1102c0b May 3, 2026
18 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the trait-errors branch May 3, 2026 00:50
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 3, 2026
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.

3 participants