Indicate origin of where type parameter for uninferred types
This commit is contained in:
parent
12307b3b08
commit
8a4632dec6
28 changed files with 97 additions and 41 deletions
|
|
@ -2,7 +2,7 @@ error[E0284]: type annotations needed
|
|||
--> $DIR/issue-12028.rs:27:14
|
||||
|
|
||||
LL | self.input_stream(&mut stream);
|
||||
| ^^^^^^^^^^^^ cannot infer type for type parameter `H`
|
||||
| ^^^^^^^^^^^^ cannot infer type for type parameter `H` declared on the trait `StreamHash`
|
||||
|
|
||||
= note: cannot resolve `<_ as StreamHasher>::S == <H as StreamHasher>::S`
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0282]: type annotations needed
|
|||
--> $DIR/issue-16966.rs:2:5
|
||||
|
|
||||
LL | panic!(std::default::Default::default());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `M`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `M` declared on the function `begin_panic`
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0282]: type annotations needed for `B<T>`
|
|||
--> $DIR/issue-17551.rs:6:15
|
||||
|
|
||||
LL | let foo = B(marker::PhantomData);
|
||||
| --- ^ cannot infer type for type parameter `T`
|
||||
| --- ^ cannot infer type for type parameter `T` declared on the struct `B`
|
||||
| |
|
||||
| consider giving `foo` the explicit type `B<T>`, where the type parameter `T` is specified
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ LL | let (tx, rx) = channel();
|
|||
| -------- consider giving this pattern the explicit type `(std::sync::mpsc::Sender<Foo<T>>, std::sync::mpsc::Receiver<Foo<T>>)`, where the type parameter `T` is specified
|
||||
...
|
||||
LL | tx.send(Foo{ foo: PhantomData });
|
||||
| ^^^ cannot infer type for type parameter `T`
|
||||
| ^^^ cannot infer type for type parameter `T` declared on the struct `Foo`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0282]: type annotations needed
|
|||
--> $DIR/issue-5062.rs:1:29
|
||||
|
|
||||
LL | fn main() { format!("{:?}", None); }
|
||||
| ^^^^ cannot infer type for type parameter `T`
|
||||
| ^^^^ cannot infer type for type parameter `T` declared on the enum `Option`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0282]: type annotations needed
|
|||
--> $DIR/issue-6458-2.rs:3:21
|
||||
|
|
||||
LL | format!("{:?}", None);
|
||||
| ^^^^ cannot infer type for type parameter `T`
|
||||
| ^^^^ cannot infer type for type parameter `T` declared on the enum `Option`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0282]: type annotations needed
|
|||
--> $DIR/issue-6458-3.rs:4:5
|
||||
|
|
||||
LL | mem::transmute(0);
|
||||
| ^^^^^^^^^^^^^^ cannot infer type for type parameter `U`
|
||||
| ^^^^^^^^^^^^^^ cannot infer type for type parameter `U` declared on the function `transmute`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0282]: type annotations needed
|
|||
--> $DIR/issue-6458.rs:9:4
|
||||
|
|
||||
LL | foo(TypeWithState(marker::PhantomData));
|
||||
| ^^^ cannot infer type for type parameter `State`
|
||||
| ^^^ cannot infer type for type parameter `State` declared on the function `foo`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue