-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Elide generic arguments in "no method found" errors if they're irrelevant #81576
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Inspired by this question on discord:
Repro: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e270ca9a0ae009a8f34af6bc31c0ce90
Error:
It would be nice if rustc could notice that
Map<T>never hasextendfor anyT, and use that information to simplify the error message to justin order to focus the user better on the relevant part.
Can the name resolution engine do that? (It can for a generic parameter, of course, but then it's only looking at the known trait bounds, which is a little different.)