hax
hax copied to clipboard
Trait resolution crash on coinductive goal
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).
Another fun one:
trait A<T> {}
struct B<T> where B<T>: A<B<T>> { t: T }
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.
Still relevant