-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait system
Description
let v = vec![1, 2, 3];
let boxed = Box::new(v.iter()) as Box<Iterator<Item=i32>>;
boxed.max() // IteratorExt::max(*boxed) also failsThis 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait system
Type
Fields
Give feedbackNo fields configured for issues without a type.