File tree 1 file changed +5
-4
lines changed
compiler/rustc_ast_pretty/src
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -380,24 +380,25 @@ impl Printer {
380
380
381
381
fn check_stack ( & mut self , mut k : usize ) {
382
382
while let Some ( & x) = self . scan_stack . front ( ) {
383
- match self . buf [ x] . token {
383
+ let mut entry = & mut self . buf [ x] ;
384
+ match entry. token {
384
385
Token :: Begin ( _) => {
385
386
if k == 0 {
386
387
break ;
387
388
}
388
389
self . scan_stack . pop_front ( ) . unwrap ( ) ;
389
- self . buf [ x ] . size += self . right_total ;
390
+ entry . size += self . right_total ;
390
391
k -= 1 ;
391
392
}
392
393
Token :: End => {
393
394
// paper says + not =, but that makes no sense.
394
395
self . scan_stack . pop_front ( ) . unwrap ( ) ;
395
- self . buf [ x ] . size = 1 ;
396
+ entry . size = 1 ;
396
397
k += 1 ;
397
398
}
398
399
_ => {
399
400
self . scan_stack . pop_front ( ) . unwrap ( ) ;
400
- self . buf [ x ] . size += self . right_total ;
401
+ entry . size += self . right_total ;
401
402
if k == 0 {
402
403
break ;
403
404
}
You can’t perform that action at this time.
0 commit comments