Skip to content
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

Introduce enter_forall to supercede instantiate_binder_with_placeholders #120544

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Feb 1, 2024

r? @lcnr

Long term we'd like to experiment with decrementing the universe count after "exiting" binders so that we do not end up creating infer vars in non-root universes even when they logically reside in the root universe. The fact that we dont do this currently results in a number of issues in the new trait solver where we consider goals to be ambiguous because otherwise it would require lowering the universe of an infer var. i.e. the goal ?x.0 eq <T as Trait<?y.1>>::Assoc where the alias is rigid would not be able to instantiate ?x with the alias as there would be a universe error.

This PR is the first-ish sort of step towards being able to implement this as eventually we would want to decrement the universe in enter_forall. Unfortunately its Difficult to actually implement decrementing universes nicely so this is a separate step which moves us closer to the long term goal ✨

@BoxyUwU BoxyUwU marked this pull request as ready for review February 1, 2024 04:59
@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2024

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Type relation code was changed

cc @compiler-errors, @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 1, 2024
@bors
Copy link
Contributor

bors commented Feb 4, 2024

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

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

some nits, then r=me. Please make sure to remove all FIXME(tree_universes) from enter_forall calls

compiler/rustc_infer/src/infer/mod.rs Outdated Show resolved Hide resolved
compiler/rustc_infer/src/infer/relate/higher_ranked.rs Outdated Show resolved Hide resolved
compiler/rustc_infer/src/infer/relate/higher_ranked.rs Outdated Show resolved Hide resolved
compiler/rustc_infer/src/infer/relate/higher_ranked.rs Outdated Show resolved Hide resolved
compiler/rustc_type_ir/src/region_kind.rs Outdated Show resolved Hide resolved
@BoxyUwU BoxyUwU force-pushed the enter_forall branch 2 times, most recently from 9544ee1 to b6f0a77 Compare February 6, 2024 10:27
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Feb 6, 2024

@bors r=lcnr rollup=never

@bors
Copy link
Contributor

bors commented Feb 6, 2024

📌 Commit b6f0a77 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2024
@lcnr
Copy link
Contributor

lcnr commented Feb 6, 2024

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 6, 2024
@compiler-errors
Copy link
Member

it would be nice if this pr got a description too :> i know what it's doing, but others may not

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Feb 6, 2024

I KNEW I FORGOT SOMETHING

@BoxyUwU BoxyUwU added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 8, 2024
@lcnr
Copy link
Contributor

lcnr commented Feb 8, 2024

r=me after ci

@rust-log-analyzer

This comment has been minimized.

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Feb 8, 2024

@bors r=lcnr rollup=never

@bors
Copy link
Contributor

bors commented Feb 8, 2024

📌 Commit f867742 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2024
@bors
Copy link
Contributor

bors commented Feb 8, 2024

⌛ Testing commit f867742 with merge c29082f...

@bors
Copy link
Contributor

bors commented Feb 8, 2024

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing c29082f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 8, 2024
@bors bors merged commit c29082f into rust-lang:master Feb 8, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 8, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c29082f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 662.316s -> 662.416s (0.02%)
Artifact size: 308.26 MiB -> 308.28 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants