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

Fold item bounds before proving them in check_type_bounds in new solver #125786

Merged
merged 2 commits into from
May 31, 2024

Conversation

compiler-errors
Copy link
Member

Vaguely confident that this is sufficient to prevent rust-lang/trait-system-refactor-initiative#46 and rust-lang/trait-system-refactor-initiative#62.

This is not the "correct" solution, but will probably suffice until coinduction, at which point we implement the right solution (check_type_bounds must prove Assoc<...> alias-eq ConcreteType, normalizing requires proving item bounds).

r? 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 May 30, 2024
Comment on lines +2029 to +2030
let trait_projection_ty = Ty::new_projection(tcx, trait_ty.def_id, rebased_args);
let impl_identity_ty = tcx.type_of(impl_ty.def_id).instantiate_identity();
Copy link
Contributor

Choose a reason for hiding this comment

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

move this into the next_solver branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

then it happens once per for mut obligation in util::elaborate(tcx, obligations) {.

I could invert the if statement, and duplicate the for loop?

Copy link
Contributor

Choose a reason for hiding this comment

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

you're right, didn't see the for loop 👍

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.

r=me after nit

@lcnr
Copy link
Contributor

lcnr commented May 30, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 30, 2024

📌 Commit 5c68eb3 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 May 30, 2024
@lcnr
Copy link
Contributor

lcnr commented May 30, 2024

@bors rollup=always

fmease added a commit to fmease/rust that referenced this pull request May 30, 2024
…r=lcnr

Fold item bounds before proving them in `check_type_bounds` in new solver

Vaguely confident that this is sufficient to prevent rust-lang/trait-system-refactor-initiative#46 and rust-lang/trait-system-refactor-initiative#62.

This is not the "correct" solution, but will probably suffice until coinduction, at which point we implement the right solution (`check_type_bounds` must prove `Assoc<...> alias-eq ConcreteType`, normalizing requires proving item bounds).

r? lcnr
bors added a commit to rust-lang-ci/rust that referenced this pull request May 31, 2024
…lcnr

Fold item bounds before proving them in `check_type_bounds` in new solver

Vaguely confident that this is sufficient to prevent rust-lang/trait-system-refactor-initiative#46 and rust-lang/trait-system-refactor-initiative#62.

This is not the "correct" solution, but will probably suffice until coinduction, at which point we implement the right solution (`check_type_bounds` must prove `Assoc<...> alias-eq ConcreteType`, normalizing requires proving item bounds).

r? lcnr
@bors
Copy link
Contributor

bors commented May 31, 2024

⌛ Testing commit 5c68eb3 with merge 4a39657...

@fmease
Copy link
Member

fmease commented May 31, 2024

@bors retry (yielding to #125794)

bors added a commit to rust-lang-ci/rust that referenced this pull request May 31, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#125635 (Rename HIR `TypeBinding` to `AssocItemConstraint` and related cleanup)
 - rust-lang#125774 (Avoid unwrap diag.code directly in note_and_explain_type_err)
 - rust-lang#125786 (Fold item bounds before proving them in `check_type_bounds` in new solver)
 - rust-lang#125790 (Don't recompute `tail` in `lower_stmts`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ab55d42 into rust-lang:master May 31, 2024
6 of 7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 31, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 31, 2024
Rollup merge of rust-lang#125786 - compiler-errors:fold-item-bounds, r=lcnr

Fold item bounds before proving them in `check_type_bounds` in new solver

Vaguely confident that this is sufficient to prevent rust-lang/trait-system-refactor-initiative#46 and rust-lang/trait-system-refactor-initiative#62.

This is not the "correct" solution, but will probably suffice until coinduction, at which point we implement the right solution (`check_type_bounds` must prove `Assoc<...> alias-eq ConcreteType`, normalizing requires proving item bounds).

r? lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants