File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -598,7 +598,7 @@ pub trait StreamingIteratorMut: StreamingIterator {
598598 fn flatten ( self ) -> Flatten < Self >
599599 where
600600 Self : Sized ,
601- Self :: Item : StreamingIterator + Sized ,
601+ Self :: Item : StreamingIterator ,
602602 {
603603 Flatten {
604604 iter : self ,
@@ -2599,6 +2599,20 @@ mod test {
25992599 test ( it, & [ 1 , 2 , 3 ] ) ;
26002600 }
26012601
2602+ #[ test]
2603+ fn flatten_unsized ( ) {
2604+ type DynI32 = dyn StreamingIterator < Item = i32 > ;
2605+ let mut items = [
2606+ & mut once ( 1 ) as & mut DynI32 ,
2607+ & mut empty ( ) ,
2608+ & mut convert ( 2 ..=3 ) ,
2609+ ] ;
2610+ let iters = items. iter_mut ( ) . map ( |iter| & mut * * iter) ;
2611+ let it = convert_mut ( iters) . flatten ( ) ;
2612+
2613+ test ( it, & [ 1 , 2 , 3 ] ) ;
2614+ }
2615+
26022616 #[ test]
26032617 fn nth ( ) {
26042618 let items = [ 0 , 1 ] ;
You can’t perform that action at this time.
0 commit comments