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

Type Inference Failure on Cyclic Associated Types #14174

Closed
ZhennanWu opened this issue Feb 19, 2023 · 1 comment
Closed

Type Inference Failure on Cyclic Associated Types #14174

ZhennanWu opened this issue Feb 19, 2023 · 1 comment
Labels
C-bug Category: bug

Comments

@ZhennanWu
Copy link

Minimal Reproducible Example

trait A {
    type B: B<A=Self>;
}
trait B {
    type A: A<B=Self>;
}
struct C<T: A> {
    b: T::B
}
fn func<T:A>(c: C<T>) {
    let unknown: T::B = c.b;
}

image

Breaking the cycle by removing one Self bound would solve ths issue.

rust-analyzer version: 0.3.1402-standalone

rustc version: rustc 1.67.0-nightly (c1a859b25 2022-11-10)

relevant settings

@ZhennanWu ZhennanWu added the C-bug Category: bug label Feb 19, 2023
@lowr
Copy link
Contributor

lowr commented Feb 19, 2023

Duplicate of #12897, which is closed but tracked in upstream issue rust-lang/chalk#773.

@lowr lowr closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants