Point at source of trait bound obligations in more places#89580
Conversation
|
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
I wonder if the error is because Edit: We can land this with extra verbosity pointing at traits, I can change the test to ignore @cjgillot, I see that you touched this file. Do you know if there's any reliance on Another option would be to add an empty predicate type that represents Edit 2: I was halfway through atttempting the "signal origin in |
There was a problem hiding this comment.
Should this test be performed around the hir.span(hir_id) call?
There was a problem hiding this comment.
I thought about it, but because it is in a nested match doing that would have meant making span mutable and reassign to it in that case. Doing this kind of rebinding feels to me like a better approach most of the time.
I don't know enough the trait solving algorithm to comment on the need for the value to change when pub and unsafe change. OTOH, I would consider that any incremental code that relies on span-related invalidation to work correctly would be a red flag. So IMHO, it's fine to update the test. If you want confirmation, you'd need to ask to professional trait solvers like @jackh726. |
😂❤you give me too much credit
I would be extremely surprised if this were the case. I imagine for everything but diagnostics, we throw away the span anyways. |
There was a problem hiding this comment.
This seems… weird. Self::DIM is not a… bound, is it? Though it looks like this error itself is not quite correct in the first place.
There was a problem hiding this comment.
Associated consts in array length position cause these. It's a preexisting problem that it's only exposed here because of better obligation tracking.
nagisa
left a comment
There was a problem hiding this comment.
Looked through the test changes for now, there seem to be some unfortunate regressions at least from my perspective.
There was a problem hiding this comment.
It kind of is, but I feel it is acceptable given how many other things improve by screwing this one up (by using DUMMY_SP for trait implicit obligations).
There was a problem hiding this comment.
This seems like a regression? Is it unavoidable?
There was a problem hiding this comment.
The previous note span was wrong :-|
There was a problem hiding this comment.
After the last change we no longer show this note (and arguably never should have).
aa1f6cf to
9b3dd9c
Compare
d12ff11 to
0df3c8f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dae3bdd to
0d4fdb2
Compare
nagisa
left a comment
There was a problem hiding this comment.
This seems very nice. r=me with one remaining nit.
This comment has been minimized.
This comment has been minimized.
0d4fdb2 to
a62418a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a62418a to
1cadfe6
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors r=nagisa |
|
📌 Commit a8dcc87 has been approved by |
|
Finished benchmarking commit (b8e5ab2): comparison url. Summary: This change led to large relevant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
|
Visiting for weekly performance triage. Many other PR's over the past week have observed a similar delta to Other than that, there were a broad set of small regressions. Putting aside the ones tagged with @rustbot label: +perf-regression-triaged |
Be more thorough in using
ItemObligationandBindingObligationwhenevaluating obligations so that we can point at trait bounds that
introduced unfulfilled obligations. We no longer incorrectly point at
unrelated trait bounds (
substs-ppaux.verbose.stderr).In particular, we now point at trait bounds on method calls.
We no longer point at "obvious" obligation sources (we no longer have a
note pointing at
Traitsaying "required by a bound inTrait", likein
associated-types-no-suitable-supertrait*).We no longer point at associated items (
ImplObligation), as they didn'tadd any user actionable information, they just added noise.
Address part of #89418.