-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Print better auto-trait diagnostics when opaque return type is involved #67117
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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 lintsA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.
The following code: (playground)
gives the following error message:
There are a couple of problems here:
impl std::marker::Copywithin mentioning where it's defined. Since auto traits 'leak through'impl trait, it would probably be a good idea to reference the function where it's defined to help disambiguate between multiple distinctimpl SomeTraittypes.impl traittypes. Since we're already exposing the underlying type in the error message, we might want to say something like:'note: the anonymous return type
impl Copyof functionbar(with underlying type*const ()) does not implementstd::marker::Send.'