@@ -100,21 +100,16 @@ rustc_data_structures::static_assert_size!(LazyTokenStreamImpl, 144);
100
100
101
101
impl CreateTokenStream for LazyTokenStreamImpl {
102
102
fn create_token_stream ( & self ) -> AttrAnnotatedTokenStream {
103
- // The token produced by the final call to `{,inlined_}next` or
104
- // `{,inlined_}next_desugared` was not actually consumed by the
105
- // callback. The combination of chaining the initial token and using
106
- // `take` produces the desired result - we produce an empty
107
- // `TokenStream` if no calls were made, and omit the final token
108
- // otherwise.
103
+ // The token produced by the final call to `{,inlined_}next` was not
104
+ // actually consumed by the callback. The combination of chaining the
105
+ // initial token and using `take` produces the desired result - we
106
+ // produce an empty `TokenStream` if no calls were made, and omit the
107
+ // final token otherwise.
109
108
let mut cursor_snapshot = self . cursor_snapshot . clone ( ) ;
110
109
let tokens =
111
110
std:: iter:: once ( ( FlatToken :: Token ( self . start_token . 0 . clone ( ) ) , self . start_token . 1 ) )
112
111
. chain ( ( 0 ..self . num_calls ) . map ( |_| {
113
- let token = if cursor_snapshot. desugar_doc_comments {
114
- cursor_snapshot. next_desugared ( )
115
- } else {
116
- cursor_snapshot. next ( )
117
- } ;
112
+ let token = cursor_snapshot. next ( cursor_snapshot. desugar_doc_comments ) ;
118
113
( FlatToken :: Token ( token. 0 ) , token. 1 )
119
114
} ) )
120
115
. take ( self . num_calls ) ;
0 commit comments