-
-
Notifications
You must be signed in to change notification settings - Fork 15k
unused_associated_type_bounds are usable and useful #125560
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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.
Code
Current output
Desired output
Rationale and extra context
<dyn AssocOptOut as AssocOutput>::Foois not defined and cannot be used in any way.However, the specified associated type can still be used, as demonstrated by the blanket implementation for
Box<dyn AssocType<Foo = T>>.Moreover, it is useful, as now
Box<dyn AssocOptOut<Foo = String>>implementsAssocOptOut, for example.(So ideally the warning could be renamed. Or if enough use-cases emerge, made
allowor change in scope.)Other cases
No response
Rust Version
Playground, all channels.
Anything else?
The lint was introduced in #112319.