You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// A binary tree with nodes labelled with `T`pubstructTree<T>{pubvalue:T,publeft:Option<Box<Tree<T>>>,pubright:Option<Box<Tree<T>>>,}impl<T>Tree<T>{pubfnmap_step<F,V>(self,f:&mutFnMut(T) -> V) -> Tree<V>{Tree{left:self.left.map(|x| {let a:Tree<V> = x.map_step(f);Box::new(a)}),right:self.right.map(|x| Box::new(x.map_step(f))),value:f(self.value),}}}fnmain(){}
fails with,
hi.rs:12:58: 12:69 error: unable to infer enough type information about `_`; type annotations required [E0282]
hi.rs:12 left: self.left.map(|x| { let a: Tree<V> = x.map_step(f);
^~~~~~~~~~~
All of my attempts at helping the compiler find the right types have failed, therefore I suspect it's a bug.
The text was updated successfully, but these errors were encountered:
This,
fails with,
All of my attempts at helping the compiler find the right types have failed, therefore I suspect it's a bug.
The text was updated successfully, but these errors were encountered: