Rewrite assumptions on binders goal - #742
Open
BoxyUwU wants to merge 2 commits into
Open
Conversation
lcnr
reviewed
Jul 31, 2026
Comment on lines
+22
to
+26
| - Marker traits | ||
| - Proving auto traits for futures/coroutines (without lots of spurrious errors) | ||
| - Supporting implied bounds on uses of GATs (`where for<'a> T::Assoc<'a>: Trait`) | ||
| - Better handling of region constraints originating inside closures involving parent body regions | ||
| - Soundly supporting subtyping of higher ranked types and other functionality involving binders (`for<'a>`) |
Contributor
There was a problem hiding this comment.
mind linking to rust-lang tracking issues/bugs here?
lcnr
reviewed
Jul 31, 2026
Co-authored-by: lcnr <rust@lcnr.de>
lcnr
reviewed
Jul 31, 2026
|
|
||
| ### Interactions with -Zhigher-ranked-assumptions | ||
|
|
||
| The `-Zhigher-ranked-assumptions` flag currently exists and tries so solve some of the problems caused by this, but it is not fully general and likely not the implementation strategy we want when solving all problems in this area. |
Contributor
There was a problem hiding this comment.
Suggested change
| The `-Zhigher-ranked-assumptions` flag currently exists and tries so solve some of the problems caused by this, but it is not fully general and likely not the implementation strategy we want when solving all problems in this area. | |
| The `-Zhigher-ranked-assumptions` flag currently exists and tries so solve some of the problems caused by this, it does so in a very targeted way and cannot be easily generalized to support all our use-cases. |
lcnr
reviewed
Jul 31, 2026
Comment on lines
+64
to
+66
| Ideally we would implement a version of `-Zhigher-ranked-assumptions` which works for *all* binders, not just witness types of futures. And ideally it would be cleverer and handle the transitiveness of outlives assumptions, much like we do for normal region outlives where clauses. | ||
|
|
||
| This goal will likely subsume the `-Zhigher-ranked-assumptions` flag, though we do intend to pursue a minimal stabilization of something quite similar to it. |
Contributor
There was a problem hiding this comment.
Suggested change
| Ideally we would implement a version of `-Zhigher-ranked-assumptions` which works for *all* binders, not just witness types of futures. And ideally it would be cleverer and handle the transitiveness of outlives assumptions, much like we do for normal region outlives where clauses. | |
| This goal will likely subsume the `-Zhigher-ranked-assumptions` flag, though we do intend to pursue a minimal stabilization of something quite similar to it. | |
| This work subsumes `-Zhigher-ranked-assumptions` with an implementation which will for *all* binders, not just coroutine witness types. It handles the transitiveness of outlives assumptions, much like we do for normal region outlives where clauses and will handles arbitrary `TypeOutlives` constraints. |
lcnr
reviewed
Jul 31, 2026
|
|
||
| ### Interactions with Polonius | ||
|
|
||
| This goal is only intending to change how we handle regions *before* borrow checking and should in theory not interact with borrow checking other than resulting in potentially different region constraints for the borrow checker to check. |
Contributor
There was a problem hiding this comment.
Suggested change
| This goal is only intending to change how we handle regions *before* borrow checking and should in theory not interact with borrow checking other than resulting in potentially different region constraints for the borrow checker to check. | |
| This goal only changes how we handle region constraints before passing them to borrow checking and should in theory not interact with borrow checking other than changing the set of relevant region constraints. It is entirely distinct from polonius. |
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.
Collaborator
|
☔ The latest upstream changes (possibly #756) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I also want to rename the zulip stream I think so this shouldn't be merged before I do that and update the links :>
cc @rust-lang/types
the assumptions on binders goal got to a point where we now have a pretty good sense of things which means we can reframe the goal in terms of all the work that we actually want to go and do, rather than just being a kind of nebulous "we're going to explore and figure stuff out"
the team ask is now large instead of medium because there'll be things we want to stabilize here which means we'll probably want to talk about things in types meetings and whatnot.
Rendered