-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Retry pred_known_to_hold_modulo_regions
with fulfillment if ambiguous
#108754
Merged
Conversation
This file contains 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
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.
labels
Mar 4, 2023
I tried to minimize it but it's basically impossible. Unless someone comes up with a reproduction bottom-up, we should just merge this without a test. It fixes a P-critical. |
@bors r+ |
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
Mar 7, 2023
compiler-errors
added
the
beta-nominated
Nominated for backporting to the compiler in the beta channel.
label
Mar 7, 2023
Beta nominating since it fixes a P-critical issue. No minimization, which is a shame, but I think the fix is pretty straightforward. |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Mar 8, 2023
Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous Fixes rust-lang#108721 The problem here is that when we're checking `is_sized_raw` during codegen on some type that has a lot of opaques in it, something emits several nested obligations that are individually ambiguous, but when processed together in a loop then apply modulo regions. Since the `evaluate_predicates_recursively` inner loop doesn't process predicates until they stop changing, we return `EvaluatedToAmbig`, which makes the sized check return false incorrectly. See: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/traits/select/mod.rs#L596-L606 ... Compared to the analogous loop in the new solver: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/solve/mod.rs#L481-L512 To fix this, if we get ambiguous during `pred_known_to_hold_modulo_regions`, just retry the obligation in a fulfillment context. -- Unfortunately... I don't have a test for this. I've only tested this locally. Pending minimization :/ r? types
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 8, 2023
Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous Fixes rust-lang#108721 The problem here is that when we're checking `is_sized_raw` during codegen on some type that has a lot of opaques in it, something emits several nested obligations that are individually ambiguous, but when processed together in a loop then apply modulo regions. Since the `evaluate_predicates_recursively` inner loop doesn't process predicates until they stop changing, we return `EvaluatedToAmbig`, which makes the sized check return false incorrectly. See: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/traits/select/mod.rs#L596-L606 ... Compared to the analogous loop in the new solver: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/solve/mod.rs#L481-L512 To fix this, if we get ambiguous during `pred_known_to_hold_modulo_regions`, just retry the obligation in a fulfillment context. -- Unfortunately... I don't have a test for this. I've only tested this locally. Pending minimization :/ r? types
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Mar 8, 2023
Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous Fixes rust-lang#108721 The problem here is that when we're checking `is_sized_raw` during codegen on some type that has a lot of opaques in it, something emits several nested obligations that are individually ambiguous, but when processed together in a loop then apply modulo regions. Since the `evaluate_predicates_recursively` inner loop doesn't process predicates until they stop changing, we return `EvaluatedToAmbig`, which makes the sized check return false incorrectly. See: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/traits/select/mod.rs#L596-L606 ... Compared to the analogous loop in the new solver: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/solve/mod.rs#L481-L512 To fix this, if we get ambiguous during `pred_known_to_hold_modulo_regions`, just retry the obligation in a fulfillment context. -- Unfortunately... I don't have a test for this. I've only tested this locally. Pending minimization :/ r? types
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 8, 2023
Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous Fixes rust-lang#108721 The problem here is that when we're checking `is_sized_raw` during codegen on some type that has a lot of opaques in it, something emits several nested obligations that are individually ambiguous, but when processed together in a loop then apply modulo regions. Since the `evaluate_predicates_recursively` inner loop doesn't process predicates until they stop changing, we return `EvaluatedToAmbig`, which makes the sized check return false incorrectly. See: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/traits/select/mod.rs#L596-L606 ... Compared to the analogous loop in the new solver: https://github.com/rust-lang/rust/blob/f15f0ea73972786e426732c5b92ba9a904b866c4/compiler/rustc_trait_selection/src/solve/mod.rs#L481-L512 To fix this, if we get ambiguous during `pred_known_to_hold_modulo_regions`, just retry the obligation in a fulfillment context. -- Unfortunately... I don't have a test for this. I've only tested this locally. Pending minimization :/ r? types
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 9, 2023
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#108754 (Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous) - rust-lang#108759 (1.41.1 supported 32-bit Apple targets) - rust-lang#108839 (Canonicalize root var when making response from new solver) - rust-lang#108856 (Remove DropAndReplace terminator) - rust-lang#108882 (Tweak E0740) - rust-lang#108898 (Set `LIBC_CHECK_CFG=1` when building Rust code in bootstrap) - rust-lang#108911 (Improve rustdoc-gui/tester.js code a bit) - rust-lang#108916 (Remove an unused return value in `rustc_hir_typeck`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
rustbot
added
the
beta-accepted
Accepted for backporting to the compiler in the beta channel.
label
Mar 9, 2023
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Mar 10, 2023
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#108754 (Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous) - rust-lang#108759 (1.41.1 supported 32-bit Apple targets) - rust-lang#108839 (Canonicalize root var when making response from new solver) - rust-lang#108856 (Remove DropAndReplace terminator) - rust-lang#108882 (Tweak E0740) - rust-lang#108898 (Set `LIBC_CHECK_CFG=1` when building Rust code in bootstrap) - rust-lang#108911 (Improve rustdoc-gui/tester.js code a bit) - rust-lang#108916 (Remove an unused return value in `rustc_hir_typeck`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Mark-Simulacrum
removed
the
beta-nominated
Nominated for backporting to the compiler in the beta channel.
label
Mar 11, 2023
Merged
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 17, 2023
…k-Simulacrum [beta] backport This PR backports: - rust-lang#108901: fix: evaluate with wrong obligation stack - rust-lang#108754: Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous - rust-lang#108691: fix multiple issues when promoting type-test subject It also bumps to the released stable. r? `@Mark-Simulacrum`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
beta-accepted
Accepted for backporting to the compiler in the beta channel.
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.
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.
Fixes #108721
The problem here is that when we're checking
is_sized_raw
during codegen on some type that has a lot of opaques in it, something emits several nested obligations that are individually ambiguous, but when processed together in a loop then apply modulo regions. Since theevaluate_predicates_recursively
inner loop doesn't process predicates until they stop changing, we returnEvaluatedToAmbig
, which makes the sized check return false incorrectly. See:rust/compiler/rustc_trait_selection/src/traits/select/mod.rs
Lines 596 to 606 in f15f0ea
... Compared to the analogous loop in the new solver:
rust/compiler/rustc_trait_selection/src/solve/mod.rs
Lines 481 to 512 in f15f0ea
To fix this, if we get ambiguous during
pred_known_to_hold_modulo_regions
, just retry the obligation in a fulfillment context.--
Unfortunately... I don't have a test for this. I've only tested this locally. Pending minimization :/
r? types