-
Notifications
You must be signed in to change notification settings - Fork 13.3k
structured suggestion for E0223 ambiguous associated type #54980
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
structured suggestion for E0223 ambiguous associated type #54980
Conversation
Wait, @estebank is currently the assignee for four other open PRs; we can do reviewer load-balancing better than this r? @davidtwco |
src/librustc_typeck/astconv.rs
Outdated
@@ -1093,10 +1093,12 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { | |||
name: &str) { | |||
struct_span_err!(self.tcx().sess, span, E0223, "ambiguous associated type") | |||
.span_label(span, "ambiguous associated type") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this label which simply repeats the error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, with the change to a suggestion, this no longer improves the error.
src/test/ui/error-codes/E0223.stderr
Outdated
| ^^^^^^^^^^ | ||
| | | ||
| ambiguous associated type | ||
| help: use fully-qualified syntax: `<Type as MyTrait>::X` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Type
a default? If it is, then it shouldn't be machine applicable in those cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| ambiguous associated type | ||
| help: use fully-qualified syntax: `<(dyn std::marker::Send + 'static) as Trait>::AssocTy` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you verify that this suggestion is actually accepted code?
It looks like we tend to use angle-brackets around the placeholder in the few other places we use `Applicability::HasPlaceholders`, but that would be confusing here, so ...
7deaef2
to
a5de379
Compare
It turns out that I was super-careless yesterday and failed to notice that the suggestions here actually contain placeholders (1 2). It's lucky that we have |
Lgtm |
@bors r+ |
📌 Commit a5de379 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
(routine (and when are we going to be done finding these, anyway?) but something that stuck out to me while glancing at #54970)
r? @estebank