-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve diagnostics for missing associated types #60595
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
estebank
added
A-associated-items
Area: Associated items (types, constants & functions)
A-diagnostics
Area: Messages for errors, warnings, and lints
labels
May 7, 2019
jonas-schievink
added
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 7, 2019
cc @varkor |
It mentions all of the types that need the associated type set, but the span is still the same. |
estebank
added
the
D-papercut
Diagnostics: An error or lint that needs small tweaks.
label
Oct 8, 2019
#67268 touches this part of the codebase. It doesn't address it, but it should be possible to build on it to do so. With that PR, the output is
|
Centril
added a commit
to Centril/rust
that referenced
this issue
Dec 20, 2019
Tweak errors for missing associated types and type parameters * On `dyn Trait` missing associated types, provide a structured suggestion for them * On missing type parameters, provide structured suggestion for them * Point at trait definition when missing required type parameter * Tweak output of E0658 * Tweak wording of E0719 * Account for `Trait1 + Trait2` case Fix rust-lang#66380, fix rust-lang#60595. CC rust-lang#63711.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When the user fails to specify associated types for a trait object, the span used for the label
associated type `Output` must be specified
is the entire trait object, when it should ideally just be the trait (bound) from which the associated type is missing.For example, we currently get:
when we really want something like:
Note that PR #59445 will ensure that there at least are two labels in the above example, which is more correct, although the spans of both labels will still be the entire trait object.
See also #59445 (comment).
CC @estebank @eddyb @Centril
The text was updated successfully, but these errors were encountered: