From 3fe346e7a3776d01541fc973c4a7bb686ef3b1a8 Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 14 Feb 2022 13:25:26 +0100 Subject: add new `emit_inference_failure_err` --- src/test/ui/array-slice-vec/infer_array_len.stderr | 6 +++++- src/test/ui/array-slice-vec/vector-no-ann.stderr | 11 +++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src/test/ui/array-slice-vec') 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` - --> $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`, 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 = Vec::new(); + | ++++++++ error: aborting due to previous error -- cgit 1.4.1-3-g733a5