diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-11-18 21:00:24 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-11-21 19:24:31 -0800 |
| commit | 34f03c01f688c0653b080914d4ab83461e1cfae2 (patch) | |
| tree | a0322297f13c69be893336c0bfc17ec84824f452 /src/test/ui/numeric | |
| parent | f11759d38c70d3df67135f88a682701c1cf9762a (diff) | |
Point at type in `let` assignment on type errors
Diffstat (limited to 'src/test/ui/numeric')
| -rw-r--r-- | src/test/ui/numeric/const-scope.stderr | 16 | ||||
| -rw-r--r-- | src/test/ui/numeric/numeric-cast-2.stderr | 12 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/test/ui/numeric/const-scope.stderr b/src/test/ui/numeric/const-scope.stderr index c6ddb35ddf5..6e1990e3a72 100644 --- a/src/test/ui/numeric/const-scope.stderr +++ b/src/test/ui/numeric/const-scope.stderr @@ -14,19 +14,25 @@ error[E0308]: mismatched types --> $DIR/const-scope.rs:5:18 | LL | let c: i32 = 1i8; - | ^^^ expected `i32`, found `i8` + | --- ^^^ expected `i32`, found `i8` + | | + | expected due to this error[E0308]: mismatched types --> $DIR/const-scope.rs:6:17 | LL | let d: i8 = c; - | ^ expected `i8`, found `i32` + | -- ^ expected `i8`, found `i32` + | | + | expected due to this error[E0308]: mismatched types --> $DIR/const-scope.rs:10:18 | LL | let c: i32 = 1i8; - | ^^^ expected `i32`, found `i8` + | --- ^^^ expected `i32`, found `i8` + | | + | expected due to this | help: change the type of the numeric literal from `i8` to `i32` | @@ -37,7 +43,9 @@ error[E0308]: mismatched types --> $DIR/const-scope.rs:11:17 | LL | let d: i8 = c; - | ^ expected `i8`, found `i32` + | -- ^ expected `i8`, found `i32` + | | + | expected due to this | help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/numeric/numeric-cast-2.stderr b/src/test/ui/numeric/numeric-cast-2.stderr index 133db19780c..465b507b788 100644 --- a/src/test/ui/numeric/numeric-cast-2.stderr +++ b/src/test/ui/numeric/numeric-cast-2.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-2.rs:5:18 | LL | let x: u16 = foo(); - | ^^^^^ expected `u16`, found `i32` + | --- ^^^^^ expected `u16`, found `i32` + | | + | expected due to this | help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit | @@ -13,7 +15,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-2.rs:7:18 | LL | let y: i64 = x + x; - | ^^^^^ expected `i64`, found `u16` + | --- ^^^^^ expected `i64`, found `u16` + | | + | expected due to this | help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit | @@ -24,7 +28,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-2.rs:9:18 | LL | let z: i32 = x + x; - | ^^^^^ expected `i32`, found `u16` + | --- ^^^^^ expected `i32`, found `u16` + | | + | expected due to this | help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit | |
