-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
indicate origin of where type parameter for uninferred types #67277
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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 lintsE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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.
Over in #65951, @estebank and I were discussing that we could improve the error message in cases like:
rust/src/test/ui/async-await/unresolved_type_param.rs
Lines 8 to 14 in 3964a55
Presently, we say:
https://github.com/rust-lang/rust/blob/master/src/test/ui/async-await/unresolved_type_param.stderr#L1-L5
but this
Twe reference comes from the definition ofbar:rust/src/test/ui/async-await/unresolved_type_param.rs
Line 6 in 3964a55
it'd be nice if we said "cannot infer value for type parameter
Tdeclared on the fnbar".I believe that name comes from the
TypeParameterDefinitioninformation that we track as part of a type variable's origin:rust/src/librustc/infer/error_reporting/need_type_info.rs
Lines 159 to 161 in 3964a55
So we could do this by modifying that variant to track the
DefIdof the type parameter and then looking at the parent to derive the context.This issue has been assigned to @ohadravid via this comment.