Suboptimal diagnostics when trying to create a trait object for a trait with GATs #103155
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-GATs
Area: Generic associated types (GATs)
D-terse
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
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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
The text was updated successfully, but these errors were encountered: