Skip to content

Rewrite assumptions on binders goal - #742

Open
BoxyUwU wants to merge 2 commits into
mainfrom
assbind_rewrite
Open

Rewrite assumptions on binders goal#742
BoxyUwU wants to merge 2 commits into
mainfrom
assbind_rewrite

Conversation

@BoxyUwU

@BoxyUwU BoxyUwU commented Jul 31, 2026

Copy link
Copy Markdown
Member

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

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>`)

@lcnr lcnr Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind linking to rust-lang tracking issues/bugs here?

View changes since the review

Comment thread src/2026/next-gen-region-constraints.md Outdated
Co-authored-by: lcnr <rust@lcnr.de>

### 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.

@lcnr lcnr Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

View changes since the review

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.

@lcnr lcnr Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

View changes since the review


### 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.

@lcnr lcnr Jul 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

View changes since the review

@lcnr lcnr added the I-types-nominated Nominated for discussion of the types team. label Jul 31, 2026
@nxsaken

This comment was marked as outdated.

@rustbot

This comment was marked as outdated.

@nxsaken

This comment was marked as outdated.

@rustbot

This comment was marked as outdated.

@nxsaken nxsaken added I-types-nominated Nominated for discussion of the types team. and removed I-types-nominated Nominated for discussion of the types team. labels Jul 31, 2026
@BoxyUwU BoxyUwU mentioned this pull request Aug 6, 2026
@rustbot

rustbot commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #756) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-types-nominated Nominated for discussion of the types team.

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

4 participants