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