-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tweak spans for trait bounds on associated types #85799
Conversation
r? @varkor (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
src/test/ui/generic-associated-types/issue-47206-where-clause.stderr
Outdated
Show resolved
Hide resolved
| | ||
LL | type Item<'a>: std::ops::Deref<Target = T>; | ||
| ---------- required by this bound in `UnsafeCopy::Item` | ||
... | ||
LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T { | ||
| - this type parameter | ||
LL | type Item<'a> = T; | ||
| ^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found associated type | ||
| ^ expected type parameter `T`, found 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.
This seems somewhat confusing, but thankfully we provide a structured suggestion.
LL | let v = Unit2.m( | ||
| ^ expected struct `Unit4`, found associated type | ||
| ^ type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]> as T0<'r, (<Unit2 as Ty<'r>>::V,)>>::O == <_ as Ty<'r>>::V` |
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.
That's quite a mouthful 😬
You are truly amazing. Thank you for making the suggestion even better! ❤️ |
340972a
to
3956224
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I don't have time to review this right now. Going to reassign to r? @pnkfelix, as they've already taken a look at it. Apologies for taking so long to get around to this. |
3de9f42
to
5d93231
Compare
This comment has been minimized.
This comment has been minimized.
5d93231
to
0cca15d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Finished benchmarking commit (76d48c2e95803f4154d13bfa62b71ed9ba7d2d1d): comparison url. Summary: This change led to very large relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
Finished benchmarking commit (76d48c2e95803f4154d13bfa62b71ed9ba7d2d1d): comparison url. Summary: This change led to very large relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 979937e with merge 041d85b0a9a7ac359e1292be7168d6b5c0508d26... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
☀️ Try build successful - checks-actions |
Queued 041d85b0a9a7ac359e1292be7168d6b5c0508d26 with parent 2f4da62, future comparison URL. |
Finished benchmarking commit (041d85b0a9a7ac359e1292be7168d6b5c0508d26): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
Going to mark this as waiting on author. Seems like it needs a rebase and perf fix. |
Closing this as it has bitrotted |
Provide more information on projection failure, by pointing at the associated type (the note on line 16 and the use of a note instead of a label on line 27 are new):
We are now pointing at the two places where the user can change things to make them compile: the trait bound and the associated type. We can't know for sure which of the two would be more appropriate on each case (although we already provide some suggestions when an extra trait bound would fix things), so instead we just put all the cards on the table and let the user decide for themselves with all the information at their disposal.
Reminded about this by the recent closing of #57663.