File tree 2 files changed +4
-7
lines changed
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1382,10 +1382,8 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
1382
1382
1383
1383
// Write down the order of our locals that will be promoted to the prefix.
1384
1384
{
1385
- let mut idx = 0u32 ;
1386
- for local in ineligible_locals. iter ( ) {
1387
- assignments[ local] = Ineligible ( Some ( idx) ) ;
1388
- idx += 1 ;
1385
+ for ( idx, local) in ineligible_locals. iter ( ) . enumerate ( ) {
1386
+ assignments[ local] = Ineligible ( Some ( idx as u32 ) ) ;
1389
1387
}
1390
1388
}
1391
1389
debug ! ( "generator saved local assignments: {:?}" , assignments) ;
Original file line number Diff line number Diff line change @@ -1574,9 +1574,9 @@ impl EmitterWriter {
1574
1574
1575
1575
let line_start = sm. lookup_char_pos ( parts[ 0 ] . span . lo ( ) ) . line ;
1576
1576
draw_col_separator_no_space ( & mut buffer, 1 , max_line_num_len + 1 ) ;
1577
- let mut line_pos = 0 ;
1578
1577
let mut lines = complete. lines ( ) ;
1579
- for line in lines. by_ref ( ) . take ( MAX_SUGGESTION_HIGHLIGHT_LINES ) {
1578
+ for ( line_pos, line) in lines. by_ref ( ) . take ( MAX_SUGGESTION_HIGHLIGHT_LINES ) . enumerate ( )
1579
+ {
1580
1580
// Print the span column to avoid confusion
1581
1581
buffer. puts (
1582
1582
row_num,
@@ -1587,7 +1587,6 @@ impl EmitterWriter {
1587
1587
// print the suggestion
1588
1588
draw_col_separator ( & mut buffer, row_num, max_line_num_len + 1 ) ;
1589
1589
buffer. append ( row_num, line, Style :: NoStyle ) ;
1590
- line_pos += 1 ;
1591
1590
row_num += 1 ;
1592
1591
}
1593
1592
You can’t perform that action at this time.
0 commit comments