-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Spurious 'conflicting implementations' error when specializing a type with a compilation error #68830
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-specializationArea: Trait impl specializationArea: Trait impl specializationC-bugCategory: This is a bug.Category: This is a bug.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.F-specialization`#![feature(specialization)]``#![feature(specialization)]`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-specializationArea: Trait impl specializationArea: Trait impl specializationC-bugCategory: This is a bug.Category: This is a bug.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.F-specialization`#![feature(specialization)]``#![feature(specialization)]`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:
gives the following errors:
For some reason, the fact that the definition of
BadStructhas an error (MissingTypeis not defining) causes a 'conflicting implementations' error to be emitted whenBadStructhas a specialized impl. IfMissingTypeis changed to a type which actually exists (e.g.()), the 'conflicting implementations' error disappears.I found this when working on
rustc- a missingusestatement caused 30 spurious specialization-related errors to be emiited, which all disappeared when I added the missing import.