File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
compiler/rustc_ast_pretty/src Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -380,24 +380,25 @@ impl Printer {
380380
381381 fn check_stack ( & mut self , mut k : usize ) {
382382 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 {
384385 Token :: Begin ( _) => {
385386 if k == 0 {
386387 break ;
387388 }
388389 self . scan_stack . pop_front ( ) . unwrap ( ) ;
389- self . buf [ x ] . size += self . right_total ;
390+ entry . size += self . right_total ;
390391 k -= 1 ;
391392 }
392393 Token :: End => {
393394 // paper says + not =, but that makes no sense.
394395 self . scan_stack . pop_front ( ) . unwrap ( ) ;
395- self . buf [ x ] . size = 1 ;
396+ entry . size = 1 ;
396397 k += 1 ;
397398 }
398399 _ => {
399400 self . scan_stack . pop_front ( ) . unwrap ( ) ;
400- self . buf [ x ] . size += self . right_total ;
401+ entry . size += self . right_total ;
401402 if k == 0 {
402403 break ;
403404 }
You can’t perform that action at this time.
0 commit comments