-
Notifications
You must be signed in to change notification settings - Fork 13.5k
typeck: when suggesting associated fns, do not show call site as fallback #33330
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
This does not fix #29121, that bug is about improving the diagnostics to help in both situations (when an impl is wrong and when a call is wrong) |
True, should only reference the issue. |
idx + 1, | ||
insertion, | ||
impl_ty); | ||
if item_span != span { |
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 we use span_if_local
instead with if let? r=me with that nit fixed
@Manishearth like that? |
@bors r+ yep! |
📌 Commit 832ce20 has been approved by |
let impl_span = fcx.tcx().map.def_id_span(impl_did, span); | ||
let item_span = fcx.tcx().map.def_id_span(item.def_id(), impl_span); | ||
let note_span = fcx.tcx().map.span_if_local(item.def_id()).or_else(|| { | ||
fcx.tcx().map.span_if_local(impl_did) }); |
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.
style nit: newline before closing brace
@nrc @Manishearth since this is already rollup-ed, what's the procedure to fix it? |
@birkenfeld a follow-up PR is probably best, if you're quick, @Manishearth might be able to get it into the rollup - these things often take a few goes to land. |
Just fix up this PR and I'll re-rollup. I have scripts for efficiently dealing with rollups |
@Manishearth added a followup commit here. |
@bors r+ |
📌 Commit b7821f9 has been approved by |
|
@bors r- delegate+ |
✌️ @birkenfeld can now approve this pull request |
@Manishearth wait, what? Why is this method missing? It is definitely not missing here (and compiles for me). |
Oh, it probably got changed in the rollup, Niko's error message overhaul might have tweaked things. Rebase and try building again? |
…back In case we cannot produce a span for the location of the definition, just do not show a span at all. cc: rust-lang#29121
@bors r=Manishearth |
📌 Commit 780f725 has been approved by |
typeck: when suggesting associated fns, do not show call site as fallback In case we cannot produce a span for the location of the definition, just do not show a span at all. cc: #29121
In case we cannot produce a span for the location of the definition, just do not show a span at all.
cc: #29121