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

Diesel new coherence failure: conflicting implementations of trait #131969

Closed
weiznich opened this issue Oct 20, 2024 · 3 comments · Fixed by #132001
Closed

Diesel new coherence failure: conflicting implementations of trait #131969

weiznich opened this issue Oct 20, 2024 · 3 comments · Fixed by #132001
Assignees
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Milestone

Comments

@weiznich
Copy link
Contributor

Code

I tried this code:

git clone https://github.com/diesel-rs/diesel/
cd diesel
git checkout b170af753cc3c6774f578aae1081711a09dfa2ac
cargo +nightly check -p diesel -F postgres -F 64-column-tables

I expected to see this happen: Code compiles fine

Instead, this happened: Code produces the following errors (Really long error, so I put it into a gist)

Version it worked on

It most recently worked on: Beta channel (1.83)

Version with regression

rustc --version --verbose:

rustc 1.84.0-nightly (da935398d 2024-10-19)
binary: rustc
commit-hash: da935398d582344c5b7689bd6632d8ec01b0c988
commit-date: 2024-10-19
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.1

Rustc-bisect points to a0c2aba, so cc @lcnr @compiler-errors (I'm sorry to come with the next issue there)

@rustbot modify labels: +regression-from-beta-to-nightly -regression-untriaged

@weiznich weiznich added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Oct 20, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 20, 2024
@Urgau Urgau added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. A-trait-system Area: Trait system and removed regression-untriaged Untriaged performance or correctness regression. labels Oct 20, 2024
@compiler-errors
Copy link
Member

compiler-errors commented Oct 20, 2024

(I'm sorry to come with the next issue there)

It's ok! We specifically chose to wait until after the beta release to stabilize the new solver in coherence, to get plenty of time and exposure to issues like this. Thanks for reporting :D

@Mark-Simulacrum Mark-Simulacrum changed the title Diesel stops working with new nightly compiler Diesel new coherence failure: conflicting implementations of trait Oct 20, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.83.0 milestone Oct 20, 2024
@Urgau Urgau modified the milestones: 1.83.0, 1.84.0 Oct 20, 2024
@weiznich
Copy link
Contributor Author

@Urgau I've already bisected it to a0c2aba (as written in the initial issue)

I also tried some things locally and interestingly this does not happen without the 64-column-tables feature. This feature only increases the tuple size diesel implements it's traits for, so it's quite surprising that rustc now reports that some traits conflict with each other while the same implementations work for smaller tuple sizes.

Additionally: It also might be meaningful to test with the 128-column-tables feature enabled afterwards to see if a potential fix works there as well.

@lqd lqd added E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Oct 20, 2024
@compiler-errors
Copy link
Member

I've already bisected it to a0c2aba (as written in the initial issue)

That bisection here is not super useful. It's probably better to bisect it to when it started failing in the new trait solver specifically.

I've already done that, and it bisects somewhat unsurprisingly to #130617. cc @lcnr, we probably should adjust the bail heuristic here to account for more infer vars; it looks like diesel uses lots of those.

@lcnr lcnr removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Oct 21, 2024
@lcnr lcnr self-assigned this Oct 21, 2024
@lcnr lcnr added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 21, 2024
@bors bors closed this as completed in 780a8c3 Oct 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue 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`
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants