about summary refs log tree commit diff
path: root/src/test/ui/error-codes
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2022-02-14 13:25:26 +0100
committerlcnr <rust@lcnr.de>2022-06-02 10:19:15 +0200
commit3fe346e7a3776d01541fc973c4a7bb686ef3b1a8 (patch)
treee890126d4103bf4c098a2803e0e4982d79650ed9 /src/test/ui/error-codes
parent721fc7320850596a20ad417397f5fc8820cd87da (diff)
downloadrust-3fe346e7a3776d01541fc973c4a7bb686ef3b1a8.tar.gz
rust-3fe346e7a3776d01541fc973c4a7bb686ef3b1a8.zip
add new `emit_inference_failure_err`
Diffstat (limited to 'src/test/ui/error-codes')
-rw-r--r--src/test/ui/error-codes/E0282.stderr7
-rw-r--r--src/test/ui/error-codes/E0283.stderr11
-rw-r--r--src/test/ui/error-codes/E0401.stderr9
3 files changed, 14 insertions, 13 deletions
diff --git a/src/test/ui/error-codes/E0282.stderr b/src/test/ui/error-codes/E0282.stderr
index 0f610a5e42f..d01aa3617c7 100644
--- a/src/test/ui/error-codes/E0282.stderr
+++ b/src/test/ui/error-codes/E0282.stderr
@@ -2,7 +2,12 @@ error[E0282]: type annotations needed
   --> $DIR/E0282.rs:2:9
    |
 LL |     let x = "hello".chars().rev().collect();
-   |         ^ consider giving `x` a type
+   |         ^
+   |
+help: consider giving `x` an explicit type
+   |
+LL |     let x: _ = "hello".chars().rev().collect();
+   |          +++
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0283.stderr b/src/test/ui/error-codes/E0283.stderr
index e2bab486064..a107160d11a 100644
--- a/src/test/ui/error-codes/E0283.stderr
+++ b/src/test/ui/error-codes/E0283.stderr
@@ -10,10 +10,7 @@ error[E0283]: type annotations needed
   --> $DIR/E0283.rs:35:24
    |
 LL |     let bar = foo_impl.into() * 1u32;
-   |               ---------^^^^--
-   |               |        |
-   |               |        cannot infer type for type parameter `T` declared on the trait `Into`
-   |               this method call resolves to `T`
+   |                        ^^^^
    |
 note: multiple `impl`s satisfying `Impl: Into<_>` found
   --> $DIR/E0283.rs:17:1
@@ -23,10 +20,10 @@ LL | impl Into<u32> for Impl {
    = note: and another `impl` found in the `core` crate:
            - impl<T, U> Into<U> for T
              where U: From<T>;
-help: use the fully qualified path for the potential candidate
+help: try using a fully qualified path to specify the expected types
    |
-LL |     let bar = <Impl as Into<u32>>::into(foo_impl) * 1u32;
-   |               ++++++++++++++++++++++++++        ~
+LL |     let bar = <Impl as Into<T>>::into(foo_impl) * 1u32;
+   |               ++++++++++++++++++++++++        ~
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/error-codes/E0401.stderr b/src/test/ui/error-codes/E0401.stderr
index e58c9d3116a..81715621dd9 100644
--- a/src/test/ui/error-codes/E0401.stderr
+++ b/src/test/ui/error-codes/E0401.stderr
@@ -36,13 +36,12 @@ error[E0282]: type annotations needed
   --> $DIR/E0401.rs:11:5
    |
 LL |     bfnr(x);
-   |     ^^^^ cannot infer type for type parameter `U` declared on the function `bfnr`
+   |     ^^^^ cannot infer type of the type parameter `U` declared on the function `bfnr`
    |
-help: type parameter declared here
-  --> $DIR/E0401.rs:4:13
+help: consider specifying the generic arguments
    |
-LL |     fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
-   |             ^
+LL |     bfnr::<U, V, W>(x);
+   |         +++++++++++
 
 error: aborting due to 4 previous errors