-
Notifications
You must be signed in to change notification settings - Fork 13.6k
rework GAT borrowck limitation error #145041
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
base: master
Are you sure you want to change the base?
Conversation
This PR modifies |
&& let ConstraintCategory::Predicate(span) = constraint.category | ||
&& let NllRegionVariableOrigin::Placeholder(placeholder) = origin.origin | ||
&& let Some(id) = placeholder.bound.kind.get_id() | ||
&& let Some(placeholder_id) = id.as_local() |
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 lint should ideally also work for placeholders from foreign crates by looking at the bound vars and span
from the parent predicates_of
.
Changing that is annoying and I did not do it in this PR.
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 logic will probably help a lot with various order-dependent things I introduce in my PRs, since selection of the correct placeholder is a lot less sensitive now! Thanks!
note: due to current limitations in the borrow checker, this implies a `'static` lifetime | ||
--> $DIR/implementation-not-general-enough-ice-133252.rs:16:18 | ||
| | ||
LL | fn force_send<T: Send>(_: T) {} |
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 fact that this note worked and was also applicable here feels somewhat incidental to me. It's caused by incorrectly handling the existential regions in opaque types. This is an instantiation of #110338 for opaque types instead of coroutines
5a3ddbc
to
ba8fa8f
Compare
07a0562
to
da17a53
Compare
r? BoxyUwU |
r=me after comment or not |
da17a53
to
3ebf611
Compare
The old one depends on the
ConstraintCategory
of the constraint which meant we did not emit this note if we had to prove the higher ranked trait bound due to e.g. normalization.This made it annoying brittle and caused MIR borrowck errors to be order dependent, fixes the issue in #140737 (comment).
r? types cc @amandasystems