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

fix coherence error for very large tuples™ #132001

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Oct 21, 2024

see https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/diesel.20error for an in-depth explanation of this issue. We once again specialize NormalizesTo goals to avoid the impact of erasing their expected term.

fixes #131969

r? @compiler-errors

@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 Oct 21, 2024
// causing a coherence error in diesel, see #131969. We still bail with verflow
// when later returning from the parent AliasRelate goal.
if !self.is_normalizes_to_goal {
let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region()).count();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region()).count();
let num_non_region_vars = canonical.variables.iter().filter(|c| !c.is_region() && !c.is_existential()).count();

Copy link
Member

Choose a reason for hiding this comment

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

army after this

@lcnr
Copy link
Contributor Author

lcnr commented Oct 21, 2024

@bors r=compiler-errors rollup

@bors
Copy link
Contributor

bors commented Oct 21, 2024

📌 Commit 919b61a has been approved by compiler-errors

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 Oct 21, 2024
//
// We don't do so for `NormalizesTo` goals as we erased the expected term and
// bailing with overflow here would prevent us from detecting a type-mismatch,
// causing a coherence error in diesel, see #131969. We still bail with verflow
Copy link
Member

@Noratrieb Noratrieb Oct 21, 2024

Choose a reason for hiding this comment

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

Suggested change
// causing a coherence error in diesel, see #131969. We still bail with verflow
// causing a coherence error in diesel, see #131969. We still bail with overflow

(i won't r-, you can if you want to or not)

Copy link
Member

Choose a reason for hiding this comment

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

verflow is actually a type-system specific concept :clueless:

Copy link
Member

Choose a reason for hiding this comment

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

ah i see, it describes the way crates of different versions flow through the type system

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed as part of #132026 :3

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

Rollup of 7 pull requests

Successful merges:

 - rust-lang#130350 (stabilize Strict Provenance and Exposed Provenance APIs)
 - rust-lang#131737 (linkchecker: add a reminder on broken links to add new/renamed pages to `SUMMARY.md` for mdBooks)
 - rust-lang#131991 (test: Add test for trait in FQS cast, issue rust-lang#98565)
 - rust-lang#131997 (Make `rustc_abi` compile on stable again)
 - rust-lang#131999 (Improve test coverage for `unit_bindings` lint)
 - rust-lang#132001 (fix coherence error for very large tuples™)
 - rust-lang#132003 (update ABI compatibility docs for new option-like rules)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 780a8c3 into rust-lang:master Oct 21, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2024
Rollup merge of rust-lang#132001 - lcnr:stabilize-coherence-again, r=compiler-errors

fix coherence error for very large tuples™

see https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/diesel.20error for an in-depth explanation of this issue. We once again specialize `NormalizesTo` goals to avoid the impact of erasing their expected term.

fixes rust-lang#131969

r? `@compiler-errors`
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.

Diesel new coherence failure: conflicting implementations of trait
5 participants