Repository navigation
-Zassumptions-on-binders: rewrite alias outlives constraints more goodly - #163938
Merged
rust-bors[bot] merged 2 commits intoOct 9, 2026
Merged
Conversation
Collaborator
|
|
This comment has been minimized.
This comment has been minimized.
Member
Author
|
is there nothing good in this world of ours |
Member
Author
|
blocked on #163937 I guess lol |
khyperia
reviewed
Oct 8, 2026
This comment has been minimized.
This comment has been minimized.
BoxyUwU
force-pushed
the
abby_more_correct_alias_rewriting
branch
from
October 9, 2026 12:17
94bd998 to
7d43809
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Member
Author
|
@bors r=khyperia |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Oct 9, 2026
…writing, r=khyperia -Zassumptions-on-binders: rewrite alias outlives constraints more goodly r? @khyperia best reviewed commit by commit. there are two improvements here. First, we no longer rewrite alias outlives constraints if they're not in the current universe. Previously we did so and it resulted in rewriting alias outlives constraints to `false` because of there being no assumptions available (because we only know assumptions for the current universe). I think this was just a whoopsie from my original PR because the other places we compute candidates *do* check the universe first lol. Second I merged the two codepaths which compute candidates via replacing current-universe-placeholders with bound vars. One of them did this for the whole constraint, the other did this just for the alias and elaborated the outlived region in `Alias: 'a` into an OR of all the regions larger than `'a`. e.g. `OR(Alias: 'b, Alias: 'c)` given assumptions that `'a: 'b` and `'a: 'c` hold. Merging them together makes the code a lot nicer but also is a slight correctness improvement as we can now get more specific constraints back when rewriting alias outlives, which means we need less general assumptions to prove them :3 See added test in the commit. Though, after updating the `expect` in that test it still passed on main before this PR because of rust-lang/project-assumptions-on-binders#26
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Oct 9, 2026
…writing, r=khyperia -Zassumptions-on-binders: rewrite alias outlives constraints more goodly r? @khyperia best reviewed commit by commit. there are two improvements here. First, we no longer rewrite alias outlives constraints if they're not in the current universe. Previously we did so and it resulted in rewriting alias outlives constraints to `false` because of there being no assumptions available (because we only know assumptions for the current universe). I think this was just a whoopsie from my original PR because the other places we compute candidates *do* check the universe first lol. Second I merged the two codepaths which compute candidates via replacing current-universe-placeholders with bound vars. One of them did this for the whole constraint, the other did this just for the alias and elaborated the outlived region in `Alias: 'a` into an OR of all the regions larger than `'a`. e.g. `OR(Alias: 'b, Alias: 'c)` given assumptions that `'a: 'b` and `'a: 'c` hold. Merging them together makes the code a lot nicer but also is a slight correctness improvement as we can now get more specific constraints back when rewriting alias outlives, which means we need less general assumptions to prove them :3 See added test in the commit. Though, after updating the `expect` in that test it still passed on main before this PR because of rust-lang/project-assumptions-on-binders#26
This was referenced Oct 9, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 9, 2026
…uwer Rollup of 24 pull requests Successful merges: - #161998 ( Support type-relative assoc item paths in generic param defaults & const param types) - #162106 (Helpful suggestions for incorrect address-of mutability (2)) - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`)) - #163337 (MIR move elimination [3/6]: PreciseLiveness) - #163938 (-Zassumptions-on-binders: rewrite alias outlives constraints more goodly) - #163939 (Better debug impls for some assumptions on binders types) - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD) - #163956 (Pass the unremapped path to the `rustc` invocation for doctests) - #164042 (Allow testing cg-gcc on any target) - #162443 (Do not retain `Normalization` goal errors in nested goals for `BestObligationVisitor:: non_trivial_candidates `) - #162908 (Fix - const parameters rejected when identical) - #163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`) - #163634 (move overflow lint computation into decorator) - #163666 (Updates the expect message library/core/src/time.rs) - #163727 (rigid aliases to non-rigid for fully normalized check) - #163745 (replace `fully_monomorphized` with `cx.typing_env()`) - #163912 (Fix debug assert failure in `note_obligation_cause_code_inner`) - #163950 (don't treat inherited opaques as defining) - #163972 (const-eval: ICE when we hit a non-const fn) - #164000 (When mentioning that closure doesn't implement trait, point at closure) - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported) - #164008 (properly ignore the current goal's usages) - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`) - #164025 (Less `CanonicalVarValues`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 9, 2026
Rollup merge of #163938 - BoxyUwU:abby_more_correct_alias_rewriting, r=khyperia -Zassumptions-on-binders: rewrite alias outlives constraints more goodly r? @khyperia best reviewed commit by commit. there are two improvements here. First, we no longer rewrite alias outlives constraints if they're not in the current universe. Previously we did so and it resulted in rewriting alias outlives constraints to `false` because of there being no assumptions available (because we only know assumptions for the current universe). I think this was just a whoopsie from my original PR because the other places we compute candidates *do* check the universe first lol. Second I merged the two codepaths which compute candidates via replacing current-universe-placeholders with bound vars. One of them did this for the whole constraint, the other did this just for the alias and elaborated the outlived region in `Alias: 'a` into an OR of all the regions larger than `'a`. e.g. `OR(Alias: 'b, Alias: 'c)` given assumptions that `'a: 'b` and `'a: 'c` hold. Merging them together makes the code a lot nicer but also is a slight correctness improvement as we can now get more specific constraints back when rewriting alias outlives, which means we need less general assumptions to prove them :3 See added test in the commit. Though, after updating the `expect` in that test it still passed on main before this PR because of rust-lang/project-assumptions-on-binders#26
bjorn3
pushed a commit
to rust-lang/rustc_codegen_cranelift
that referenced
this pull request
Oct 12, 2026
…uwer Rollup of 24 pull requests Successful merges: - rust-lang/rust#161998 ( Support type-relative assoc item paths in generic param defaults & const param types) - rust-lang/rust#162106 (Helpful suggestions for incorrect address-of mutability (2)) - rust-lang/rust#162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`)) - rust-lang/rust#163337 (MIR move elimination [3/6]: PreciseLiveness) - rust-lang/rust#163938 (-Zassumptions-on-binders: rewrite alias outlives constraints more goodly) - rust-lang/rust#163939 (Better debug impls for some assumptions on binders types) - rust-lang/rust#163954 (fix(bootstrap/darwin): fix rpath for distributed LLD) - rust-lang/rust#163956 (Pass the unremapped path to the `rustc` invocation for doctests) - rust-lang/rust#164042 (Allow testing cg-gcc on any target) - rust-lang/rust#162443 (Do not retain `Normalization` goal errors in nested goals for `BestObligationVisitor:: non_trivial_candidates `) - rust-lang/rust#162908 (Fix - const parameters rejected when identical) - rust-lang/rust#163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`) - rust-lang/rust#163634 (move overflow lint computation into decorator) - rust-lang/rust#163666 (Updates the expect message library/core/src/time.rs) - rust-lang/rust#163727 (rigid aliases to non-rigid for fully normalized check) - rust-lang/rust#163745 (replace `fully_monomorphized` with `cx.typing_env()`) - rust-lang/rust#163912 (Fix debug assert failure in `note_obligation_cause_code_inner`) - rust-lang/rust#163950 (don't treat inherited opaques as defining) - rust-lang/rust#163972 (const-eval: ICE when we hit a non-const fn) - rust-lang/rust#164000 (When mentioning that closure doesn't implement trait, point at closure) - rust-lang/rust#164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported) - rust-lang/rust#164008 (properly ignore the current goal's usages) - rust-lang/rust#164017 (cg_llvm: Avoid some explicit casts to `*const c_char`) - rust-lang/rust#164025 (Less `CanonicalVarValues`)
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.
r? @khyperia
best reviewed commit by commit. there are two improvements here.
First, we no longer rewrite alias outlives constraints if they're not in the current universe. Previously we did so and it resulted in rewriting alias outlives constraints to
falsebecause of there being no assumptions available (because we only know assumptions for the current universe). I think this was just a whoopsie from my original PR because the other places we compute candidates do check the universe first lol.Second I merged the two codepaths which compute candidates via replacing current-universe-placeholders with bound vars. One of them did this for the whole constraint, the other did this just for the alias and elaborated the outlived region in
Alias: 'ainto an OR of all the regions larger than'a. e.g.OR(Alias: 'b, Alias: 'c)given assumptions that'a: 'band'a: 'chold.Merging them together makes the code a lot nicer but also is a slight correctness improvement as we can now get more specific constraints back when rewriting alias outlives, which means we need less general assumptions to prove them :3 See added test in the commit.
Though, after updating the
expectin that test it still passed on main before this PR because of rust-lang/project-assumptions-on-binders#26