Incorrect suggestion to define associated type in type parameter list #116464
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
The suggestion is not valid syntax. Applying the original suggestion like so:
...leads to this error instead:
Note also that a more naive suggestion to keep the
S
parameter like so:...would fail because it's unconstrained:
Assoc
needs to be a concrete type or an associated type of an input type parameter.The diagnostic is identical in beta and nightly.
The text was updated successfully, but these errors were encountered: