]>
Commit | Line | Data |
---|---|---|
cc61c64b | 1 | error[E0282]: type annotations needed |
923072b8 | 2 | --> $DIR/unknown_type_for_closure.rs:2:13 |
cc61c64b | 3 | | |
923072b8 FG |
4 | LL | let x = |b: Vec<_>| {}; |
5 | | ^^^^^^^^^^^^^^ cannot infer type for struct `Vec<_>` | |
cc61c64b | 6 | |
923072b8 FG |
7 | error[E0282]: type annotations needed |
8 | --> $DIR/unknown_type_for_closure.rs:6:14 | |
9 | | | |
10 | LL | let x = |_| {}; | |
11 | | ^ | |
12 | | | |
13 | help: consider giving this closure parameter an explicit type | |
14 | | | |
15 | LL | let x = |_: _| {}; | |
16 | | +++ | |
17 | ||
18 | error[E0282]: type annotations needed | |
19 | --> $DIR/unknown_type_for_closure.rs:10:14 | |
20 | | | |
21 | LL | let x = |k: _| {}; | |
22 | | ^ cannot infer type | |
23 | ||
24 | error[E0282]: type annotations needed | |
25 | --> $DIR/unknown_type_for_closure.rs:14:28 | |
26 | | | |
27 | LL | let x = || -> Vec<_> { Vec::new() }; | |
28 | | ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Vec` | |
29 | | | |
30 | help: consider specifying the generic argument | |
31 | | | |
32 | LL | let x = || -> Vec<_> { Vec::<T>::new() }; | |
33 | | +++++ | |
34 | ||
35 | error: aborting due to 4 previous errors | |
cc61c64b | 36 | |
0531ce1d | 37 | For more information about this error, try `rustc --explain E0282`. |