-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Suboptimal diagnostics when trying to create a trait object for a trait with GATs #103155
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-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-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-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.
Given the following code (playground 1):
The current output is:
Following this suggestion (playground 2)...
... produces another diagnostic:
Finally, specifying the generic argument for
Bar(playground 3)...... reveals that our struggle was all for naught:
Ideally, the first snippet should produce an object safety error right away:
In case
#![feature(generic_associated_types_extended)]is enabled, E0191 should still be emitted, but the suggestion should include the generic argument forBar:@rustbot modify labels +D-terse +F-generic_associated_types