-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
When possible point at argument causing item obligation failure #64498
Conversation
r? @zackmdavis (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
8cd714c
to
0551498
Compare
I want to acknowledge that this is not the ideal solution, but my attempts at modifying the obligation preemptively and collecting an association between the |
@@ -3222,6 +3222,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
formal_tys.clone() | |||
}; | |||
|
|||
let mut final_arg_types: Vec<(usize, Ty<'_>)> = vec![]; |
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.
Seems like this is going to regress happy-path compile-time perf? (I don't expect by much but still...)
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 see no way of doing this without collecting the resolved types for the general case (there's a lazy way to do it that would only work with fully resolved types in the arguments).
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.
Yeah sure, just pointing out that there is a cost to this, which may be totally acceptable. :)
This comment has been minimized.
This comment has been minimized.
e717735
to
e16b1bc
Compare
This comment has been minimized.
This comment has been minimized.
@@ -16,6 +17,7 @@ pub fn other() { | |||
|
|||
let _ = Iterator::next(&mut ()); | |||
//~^ ERROR `()` is not an iterator | |||
//~| ERROR `()` is not an iterator |
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.
This file shows the case where we duplicate the errors. We should be able to elide the error pointing at Iterator::next
with some judicious use of Ty::Error
.
This comment has been minimized.
This comment has been minimized.
e16b1bc
to
64c9bcf
Compare
@oli-obk d38e090#diff-4cee39a7c18e8b5ec52efe4563c547fbR7-R11 😀
|
r? @Centril r=me with the elaboration you gave me privately on Discord added as a comment in some fashion. :) |
6f5a961
to
c34d9e6
Compare
@bors r=Centril |
📌 Commit c34d9e6 has been approved by |
When possible point at argument causing item obligation failure Fix rust-lang#41781, fix rust-lang#42855, fix rust-lang#46658, fix rust-lang#48099, fix rust-lang#63143.
Rollup of 8 pull requests Successful merges: - #64136 (Document From trait for LhsExpr in parser) - #64342 (factor out pluralisation remains after #64280) - #64387 (Fix redundant semicolon lint interaction with proc macro attributes) - #64498 (When possible point at argument causing item obligation failure) - #64615 (rustbuild: Turn down compression on exe installers) - #64617 (rustbuild: Turn down compression on msi installers) - #64618 (rustbuild: Improve output of `dist` step) - #64621 (Add Compatibility Notes to RELEASES.md for 1.38.0) Failed merges: r? @ghost
☀️ Test successful - checks-azure |
Either this PR or #64584 caused a major regression in rustc perf. It's hard to tell because the graph goes up on this PR, then down for a single run, then stabilizes again at the worse performance after #64584. I suggest backing out both PRs, opening new PRs, and then doing perf runs on both. That should make it clear which one cause the regression. cc @rust-lang/compiler (If I had to guess, I would guess this PR caused the regression.) |
See #64584 (comment) - I wouldn't do anything just yet. |
Fix #41781, fix #42855, fix #46658, fix #48099, fix #63143, fix #36775.