hax icon indicating copy to clipboard operation
hax copied to clipboard

Trait resolution crash on coinductive goal

Open Nadrieril opened this issue 10 months ago • 3 comments

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 avatar Feb 13 '25 13:02 Nadrieril

Another fun one:

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

Nadrieril avatar Feb 17 '25 13:02 Nadrieril

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar Apr 24 '25 01:04 github-actions[bot]

Still relevant

maximebuyse avatar Apr 24 '25 11:04 maximebuyse