Open
Description
Spawned off of #4363, specifically the example provided by @goffrie
This example code causes rustc to infinite loop (playground):
enum FingerTree<A> {
Empty,
Single(A),
Deep(Node<A>)
}
struct Node<A> {
count: i32,
front: Digit<A>,
inner: Box<FingerTree<(A,A)>>,
back: Digit<A>
}
struct Digit<A> {
count: i32,
content: [Option<A>; 4]
}
fn FingerTree<A>() -> FingerTree<A> { FingerTree::Empty }
fn main() {
let _ = FingerTree::Deep(Node { count: 0,
front: Digit { count: 0, content: [None, None, None, None] },
inner: Box::new(FingerTree::Single((1, 2))),
back: Digit { count: 0, content: [None, None, None, None] }}
);
}