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 {
598
598
fn flatten ( self ) -> Flatten < Self >
599
599
where
600
600
Self : Sized ,
601
- Self :: Item : StreamingIterator + Sized ,
601
+ Self :: Item : StreamingIterator ,
602
602
{
603
603
Flatten {
604
604
iter : self ,
@@ -2599,6 +2599,20 @@ mod test {
2599
2599
test ( it, & [ 1 , 2 , 3 ] ) ;
2600
2600
}
2601
2601
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
+
2602
2616
#[ test]
2603
2617
fn nth ( ) {
2604
2618
let items = [ 0 , 1 ] ;
You can’t perform that action at this time.
0 commit comments