File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1513,7 +1513,7 @@ impl HumanEmitter {
15131513 for line_idx in 0 ..annotated_file. lines . len ( ) {
15141514 let file = annotated_file. file . clone ( ) ;
15151515 let line = & annotated_file. lines [ line_idx] ;
1516- if let Some ( source_string) = file . get_line ( line. line_index - 1 ) {
1516+ if let Some ( source_string) = line. line_index . checked_sub ( 1 ) . and_then ( |l| file . get_line ( l ) ) {
15171517 let leading_whitespace = source_string
15181518 . chars ( )
15191519 . take_while ( |c| c. is_whitespace ( ) )
Original file line number Diff line number Diff line change 11error[E0308]: mismatched types
2- --> $DIR/mismatched-types.rs:2:20
2+ --> $DIR/file.txt:0:1
3+ |
4+ |
5+ ::: $DIR/mismatched-types.rs:2:12
36 |
47LL | let b: &[u8] = include_str!("file.txt");
5- | ----- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str`
8+ | ----- ------------------------ in this macro invocation
69 | |
710 | expected due to this
811 |
You can’t perform that action at this time.
0 commit comments