Why does the below code not compile ?
I know that you can't leave any variable partially initialised but i do initialise in the next line, So is it that it's difficult for compiler to infer that ( though i don't really think that ) or is it for some other reason that i don't understand
This code is from Too Many Linked Lists Book
pub fn push(&mut self, elem: i32) {
let new_node = Box::new(Node {
elem: elem,
next: self.head,
});
self.head = Link::More(new_node);
}