File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1290,6 +1290,10 @@ pub mod token_stream {
12901290 fn next ( & mut self ) -> Option < TokenTree > {
12911291 self . inner . next ( )
12921292 }
1293+
1294+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
1295+ self . inner . size_hint ( )
1296+ }
12931297 }
12941298
12951299 impl Debug for IntoIter {
Original file line number Diff line number Diff line change @@ -547,6 +547,13 @@ fn default_tokenstream_is_empty() {
547547 assert ! ( default_token_stream. is_empty( ) ) ;
548548}
549549
550+ #[ test]
551+ fn tokenstream_size_hint ( ) {
552+ let tokens = "a b (c d) e" . parse :: < TokenStream > ( ) . unwrap ( ) ;
553+
554+ assert_eq ! ( tokens. into_iter( ) . size_hint( ) , ( 4 , Some ( 4 ) ) ) ;
555+ }
556+
550557#[ test]
551558fn tuple_indexing ( ) {
552559 // This behavior may change depending on https://github.com/rust-lang/rust/pull/71322
You can’t perform that action at this time.
0 commit comments