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
let v = vec![1,2,3];let boxed = Box::new(v.iter())asBox<Iterator<Item=i32>>;
boxed.max()// IteratorExt::max(*boxed) also fails
This code will be failed to compile because boxed holds a trait object that is unsized, and IteratorExt requires the Sized kind so IteratorExt can only be implemented for sized types. Like IteratorExt::map(), many methods in IteratorExt consume self, so requiring a sized type is necessary.
Adding impl Iterator for Box<Iterator> (like Reader for Box<Reader>) might solve this problem, but I'm worrying about the confliction with autoderef.