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

Trait resolution crash on coinductive goal #1310

Open
Nadrieril opened this issue Feb 13, 2025 · 1 comment
Open

Trait resolution crash on coinductive goal #1310

Nadrieril opened this issue Feb 13, 2025 · 1 comment
Labels
frontend Issue in the Rust to JSON translation

Comments

@Nadrieril
Copy link
Collaborator

This causes a stack overflow, presumably related to trait resolution:

struct Node<C: Trait<Self>>(C::Assoc);

trait Trait<T> {
    type Assoc;
}

impl<T> Trait<T> for Vec<()> {
    type Assoc = Vec<T>;
}

fn main() {
    let _ = Node::<Vec<()>>(Vec::new());
}

This is valid rust code (taken from the rustc test suite).

@Nadrieril
Copy link
Collaborator Author

Another fun one:

trait A<T> {}
struct B<T> where B<T>: A<B<T>> { t: T }

@franziskuskiefer franziskuskiefer added the frontend Issue in the Rust to JSON translation label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Issue in the Rust to JSON translation
Projects
None yet
Development

No branches or pull requests

2 participants