diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-05-30 15:33:13 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-05-31 18:33:59 -0700 |
| commit | 74fb3bbee45d54e1680832ba064fa1af8d344bc0 (patch) | |
| tree | 01ab612bf99564ee00c8815ec1ec07d84c41deb9 /src/test | |
| parent | 65c2a7b18bb34547de7c716ace2e8878c2676794 (diff) | |
On type inference errors use the type argument name when possible
``` error[E0282]: type annotations needed in `std::result::Result<i32, E>` --> file7.rs:3:13 | 3 | let b = Ok(4); | - ^^ cannot infer type for `E` in `std::result::Result<i32, E>` | | | consider giving `b` a type` ```
Diffstat (limited to 'src/test')
10 files changed, 17 insertions, 17 deletions
diff --git a/src/test/ui/issues/issue-12187-1.stderr b/src/test/ui/issues/issue-12187-1.stderr index 510eeb4b9bb..5f07dbc6673 100644 --- a/src/test/ui/issues/issue-12187-1.stderr +++ b/src/test/ui/issues/issue-12187-1.stderr @@ -1,4 +1,4 @@ -error[E0282]: type annotations needed in `&_` +error[E0282]: type annotations needed in `&T` --> $DIR/issue-12187-1.rs:6:10 | LL | let &v = new(); diff --git a/src/test/ui/issues/issue-12187-2.stderr b/src/test/ui/issues/issue-12187-2.stderr index 8b12ff5f9d8..5b44278359c 100644 --- a/src/test/ui/issues/issue-12187-2.stderr +++ b/src/test/ui/issues/issue-12187-2.stderr @@ -1,4 +1,4 @@ -error[E0282]: type annotations needed in `&_` +error[E0282]: type annotations needed in `&T` --> $DIR/issue-12187-2.rs:6:10 | LL | let &v = new(); diff --git a/src/test/ui/issues/issue-17551.stderr b/src/test/ui/issues/issue-17551.stderr index 0d7a31fc60d..95af1e41b58 100644 --- a/src/test/ui/issues/issue-17551.stderr +++ b/src/test/ui/issues/issue-17551.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed in `B<_>` +error[E0282]: type annotations needed in `B<T>` --> $DIR/issue-17551.rs:6:15 | LL | let foo = B(marker::PhantomData); - | --- ^ cannot infer type for `T` in `B<_>` + | --- ^ cannot infer type for `T` in `B<T>` | | | consider giving `foo` a type diff --git a/src/test/ui/issues/issue-23046.stderr b/src/test/ui/issues/issue-23046.stderr index 1363a6f963f..102cfe0085f 100644 --- a/src/test/ui/issues/issue-23046.stderr +++ b/src/test/ui/issues/issue-23046.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed in `Expr<'_, _>` +error[E0282]: type annotations needed in `Expr<'_, VAR>` --> $DIR/issue-23046.rs:17:15 | LL | let ex = |x| { - | ^ consider giving this closure parameter the type `Expr<'_, _>` with the type parameter `VAR` specified + | ^ consider giving this closure parameter the type `Expr<'_, VAR>` with the type parameter `VAR` specified error: aborting due to previous error diff --git a/src/test/ui/issues/issue-25368.stderr b/src/test/ui/issues/issue-25368.stderr index 5fc9ab26969..a386fc94628 100644 --- a/src/test/ui/issues/issue-25368.stderr +++ b/src/test/ui/issues/issue-25368.stderr @@ -1,11 +1,11 @@ -error[E0282]: type annotations needed in `(std::sync::mpsc::Sender<Foo<_>>, std::sync::mpsc::Receiver<Foo<_>>)` +error[E0282]: type annotations needed in `(std::sync::mpsc::Sender<Foo<T>>, std::sync::mpsc::Receiver<Foo<T>>)` --> $DIR/issue-25368.rs:11:17 | LL | let (tx, rx) = channel(); | -------- consider giving the pattern a type ... LL | tx.send(Foo{ foo: PhantomData }); - | ^^^ cannot infer type for `T` in `(std::sync::mpsc::Sender<Foo<_>>, std::sync::mpsc::Receiver<Foo<_>>)` + | ^^^ cannot infer type for `T` in `(std::sync::mpsc::Sender<Foo<T>>, std::sync::mpsc::Receiver<Foo<T>>)` error: aborting due to previous error diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr index e8871efc5b2..b9fa36041b1 100644 --- a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr +++ b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed in `std::vec::Vec<_>` +error[E0282]: type annotations needed in `std::vec::Vec<T>` --> $DIR/method-ambig-one-trait-unknown-int-type.rs:24:17 | LL | let mut x = Vec::new(); - | ----- ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<_>` + | ----- ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<T>` | | | consider giving `x` a type diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr index 59a8b52a66d..a491d4516cc 100644 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr +++ b/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed in `std::vec::Vec<_>` +error[E0282]: type annotations needed in `std::vec::Vec<T>` --> $DIR/cannot_infer_local_or_vec.rs:2:13 | LL | let x = vec![]; - | - ^^^^^^ cannot infer type for `T` in `std::vec::Vec<_>` + | - ^^^^^^ cannot infer type for `T` in `std::vec::Vec<T>` | | | consider giving `x` a type | diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr index 294b6d93211..1c5b750b9b4 100644 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr +++ b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed in `(std::vec::Vec<_>,)` +error[E0282]: type annotations needed in `(std::vec::Vec<T>,)` --> $DIR/cannot_infer_local_or_vec_in_tuples.rs:2:18 | LL | let (x, ) = (vec![], ); - | ----- ^^^^^^ cannot infer type for `T` in `(std::vec::Vec<_>,)` + | ----- ^^^^^^ cannot infer type for `T` in `(std::vec::Vec<T>,)` | | | consider giving the pattern a type | diff --git a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr index 142975144d4..dda453870dc 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr @@ -1,4 +1,4 @@ -error[E0282]: type annotations needed in `std::option::Option<_>` +error[E0282]: type annotations needed in `std::option::Option<T>` --> $DIR/unboxed-closures-failed-recursive-fn-2.rs:16:32 | LL | let mut closure0 = None; diff --git a/src/test/ui/vector-no-ann.stderr b/src/test/ui/vector-no-ann.stderr index 2431927f2ac..a6c805c0c26 100644 --- a/src/test/ui/vector-no-ann.stderr +++ b/src/test/ui/vector-no-ann.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed in `std::vec::Vec<_>` +error[E0282]: type annotations needed in `std::vec::Vec<T>` --> $DIR/vector-no-ann.rs:2:16 | LL | let _foo = Vec::new(); - | ---- ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<_>` + | ---- ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<T>` | | | consider giving `_foo` a type |
