1
Fork 0

Modify primary span label for E0308

The previous output was unintuitive to users.
This commit is contained in:
Esteban Küber 2023-01-02 18:00:33 -08:00
parent 006ca9b14d
commit 62ba3e70a1
383 changed files with 889 additions and 926 deletions

View file

@ -1,12 +1,12 @@
fn main() {
let _x: i32 = [1, 2, 3];
//~^ ERROR mismatched types
//~| expected `i32`, found array
//~| expected `i32`, found `[{integer}; 3]`
let x: &[i32] = &[1, 2, 3];
let _y: &i32 = x;
//~^ ERROR mismatched types
//~| expected reference `&i32`
//~| found reference `&[i32]`
//~| expected `i32`, found slice
//~| expected `&i32`, found `&[i32]`
}

View file

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/array-not-vector.rs:2:19
|
LL | let _x: i32 = [1, 2, 3];
| --- ^^^^^^^^^ expected `i32`, found array `[{integer}; 3]`
| --- ^^^^^^^^^ expected `i32`, found `[{integer}; 3]`
| |
| expected due to this
@ -10,7 +10,7 @@ error[E0308]: mismatched types
--> $DIR/array-not-vector.rs:7:20
|
LL | let _y: &i32 = x;
| ---- ^ expected `i32`, found slice `[i32]`
| ---- ^ expected `&i32`, found `&[i32]`
| |
| expected due to this
|

View file

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/slice-to-vec-comparison.rs:4:9
|
LL | a > b;
| ^ expected array of 0 elements, found struct `Vec`
| ^ expected `&[_; 0]`, found `&Vec<u8>`
|
= note: expected reference `&[_; 0]`
found reference `&Vec<u8>`