-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Properly track ImplObligations
#91030
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Only the last commit is relevant. CC @nagisa, who reviewed the previous PR. |
This comment has been minimized.
This comment has been minimized.
3ba5d10
to
8765dd5
Compare
r? @nagisa |
This comment was marked as resolved.
This comment was marked as resolved.
8765dd5
to
5e0c8f9
Compare
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 have a hard time finding myself with enough time to give this PR the attention it deserves. Here are a couple comments I wrote last week; but otherwise you may want to consider looking for somebody who is able to dedicate a couple uninterrupted hours to review the PR.
Otherwise I'll just continue looking for an opportunity, but I can't promise it'll come soon.
note: required because it appears within the type `NoClone` | ||
--> $DIR/supertrait-auto-trait.rs:13:8 | ||
| | ||
LL | struct NoClone; | ||
| ^^^^^^^ |
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 reads weird. “because it appears within the type” is typically something one would expect to see for types with fields, but NoClone
hasn't any.
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.
Be aware that this is output only possible with feature(auto_traits)
enabled.
which is required by `Foo<T>: Bar` | ||
`T: Bar` | ||
which is required by `Foo<T>: Bar` | ||
note: trait bound `T: Bar` was not satisfied because of the requirements of the implementation of `Bar` for `_` |
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 had to look at this error message for a little while to figure out what
because of the requirements of the implementation of
Bar
for_
is trying to say here. In particular the wording to me parses to a causation of the following sort:
- We would use method
<&Foo<T> as Bar>::foo
, but cannot because there are unsatisfied trait bounds… - In particular
T: Bar
bound fromimpl<T: Default + Bar> Bar for Foo<T> {}
is not satisfied… - Which was not satisfied because
impl<T: Default + Bar> Bar for Foo<T> {}
contains this bound.
whereas what we really mean here is:
- We would use method
<&Foo<T> as Bar>::foo
, but cannot because there are unsatisfied trait bounds… - In particular
T: Bar
bound fromimpl<T: Default + Bar> Bar for Foo<T> {}
is not satisfied… - Which was not satisfied because
T
does not implementBar
..
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.
The "duplicated" output is because it points at both Default
and Bar
bounds as unsatisfied for Bar
, while it never talks about T: !Bar
beyond the first mention. Would this read better?
error[E0599]: the method `foo` exists for reference `&Foo<T>`, but its trait bounds were not satisfied
--> $DIR/missing-trait-bounds-for-method-call.rs:14:14
|
LL | struct Foo<T> {
| ------------- doesn't satisfy `Foo<T>: Bar`
...
LL | self.foo();
| ^^^ method cannot be called on `&Foo<T>` due to unsatisfied trait bounds
|
note: trait bound `T: Bar` was not satisfied
--> $DIR/missing-trait-bounds-for-method-call.rs:10:19
|
LL | impl<T: Default + Bar> Bar for Foo<T> {}
| ^^^ --- ------
| |
| unsatisfied trait bound introduced here
note: trait bound `T: Default` was not satisfied
--> $DIR/missing-trait-bounds-for-method-call.rs:10:9
|
LL | impl<T: Default + Bar> Bar for Foo<T> {}
| ^^^^^^^ --- ------
| |
| unsatisfied trait bound introduced here
help: consider restricting the type parameters to satisfy the trait bounds
|
LL | struct Foo<T> where T: Bar, T: Default {
| ++++++++++++++++++++++++
This comment was marked as resolved.
This comment was marked as resolved.
5e0c8f9
to
2984575
Compare
@oli-obk would you have time to take a look at this? |
This comment has been minimized.
This comment has been minimized.
52760bf
to
a117cf5
Compare
r? @oli-obk |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
☀️ Try build successful - checks-actions |
Queued 548649c9868f5cb125e19b7b4b74884aa901a5ae with parent 37b55c8, future comparison URL. |
Finished benchmarking commit (548649c9868f5cb125e19b7b4b74884aa901a5ae): comparison url. Summary: This benchmark run shows 25 relevant regressions 😿 to instruction counts.
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 r+ |
📌 Commit 5fd3786 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d2df372): comparison url. Summary: This benchmark run shows 19 relevant regressions 😿 to instruction counts.
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. The hit here was already anticipated. I trust that @oli-obk and @estebank will do what they can to improve performance around obligation causes @rustbot label: +perf-regression-triaged |
…estebank Clean up derived obligation creation r? `@estebank` working on fixing the perf regression from rust-lang#91030 (comment)
Instead of probing for all possible
impl
s that could have caused anImplObligation
, keep track of itsDefId
and obligation spans foraccurate error reporting.
Follow to #89580. Addresses #89418.