diff options
| author | lcnr <rust@lcnr.de> | 2022-02-14 13:25:26 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-06-02 10:19:15 +0200 |
| commit | 3fe346e7a3776d01541fc973c4a7bb686ef3b1a8 (patch) | |
| tree | e890126d4103bf4c098a2803e0e4982d79650ed9 /src/test/ui/array-slice-vec | |
| parent | 721fc7320850596a20ad417397f5fc8820cd87da (diff) | |
| download | rust-3fe346e7a3776d01541fc973c4a7bb686ef3b1a8.tar.gz rust-3fe346e7a3776d01541fc973c4a7bb686ef3b1a8.zip | |
add new `emit_inference_failure_err`
Diffstat (limited to 'src/test/ui/array-slice-vec')
| -rw-r--r-- | src/test/ui/array-slice-vec/infer_array_len.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/array-slice-vec/vector-no-ann.stderr | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/test/ui/array-slice-vec/infer_array_len.stderr b/src/test/ui/array-slice-vec/infer_array_len.stderr index 6eed4ce4f0c..8da6d97251b 100644 --- a/src/test/ui/array-slice-vec/infer_array_len.stderr +++ b/src/test/ui/array-slice-vec/infer_array_len.stderr @@ -2,9 +2,13 @@ error[E0282]: type annotations needed --> $DIR/infer_array_len.rs:19:9 | LL | let [_, _] = a.into(); - | ^^^^^^ consider giving this pattern a type + | ^^^^^^ | = note: type must be known at this point +help: consider giving this pattern a type + | +LL | let [_, _]: _ = a.into(); + | +++ error: aborting due to previous error diff --git a/src/test/ui/array-slice-vec/vector-no-ann.stderr b/src/test/ui/array-slice-vec/vector-no-ann.stderr index 8a7b8d22760..d2ea08aa474 100644 --- a/src/test/ui/array-slice-vec/vector-no-ann.stderr +++ b/src/test/ui/array-slice-vec/vector-no-ann.stderr @@ -1,10 +1,13 @@ error[E0282]: type annotations needed for `Vec<T>` - --> $DIR/vector-no-ann.rs:2:16 + --> $DIR/vector-no-ann.rs:2:9 | LL | let _foo = Vec::new(); - | ---- ^^^^^^^^ cannot infer type for type parameter `T` - | | - | consider giving `_foo` the explicit type `Vec<T>`, where the type parameter `T` is specified + | ^^^^ + | +help: consider giving `_foo` an explicit type, where the type for type parameter `T` is specified + | +LL | let _foo: Vec<T> = Vec::new(); + | ++++++++ error: aborting due to previous error |
