File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ fn a ( ) {
2+ [ 0 ; [ |_: _ & _ | ( ) ] . len ( ) ]
3+ //~^ ERROR expected `,`, found `&`
4+ //~| ERROR type annotations needed
5+ //~| ERROR mismatched types
6+ }
7+
8+ fn b ( ) {
9+ [ 0 ; [ |f @ & ref _| { } ; 0 ] . len ( ) ] ;
10+ //~^ ERROR expected identifier, found reserved identifier `_`
11+ }
12+
13+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: expected `,`, found `&`
2+ --> $DIR/issue-66706.rs:2:16
3+ |
4+ LL | [0; [|_: _ &_| ()].len()]
5+ | -^ expected `,`
6+ | |
7+ | help: missing `,`
8+
9+ error: expected identifier, found reserved identifier `_`
10+ --> $DIR/issue-66706.rs:9:20
11+ |
12+ LL | [0; [|f @ &ref _| {} ; 0 ].len() ];
13+ | ^ expected identifier, found reserved identifier
14+
15+ error[E0282]: type annotations needed
16+ --> $DIR/issue-66706.rs:2:11
17+ |
18+ LL | [0; [|_: _ &_| ()].len()]
19+ | ^ consider giving this closure parameter a type
20+
21+ error[E0308]: mismatched types
22+ --> $DIR/issue-66706.rs:2:5
23+ |
24+ LL | fn a() {
25+ | - help: try adding a return type: `-> [{integer}; _]`
26+ LL | [0; [|_: _ &_| ()].len()]
27+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]`
28+
29+ error: aborting due to 4 previous errors
30+
31+ Some errors have detailed explanations: E0282, E0308.
32+ For more information about an error, try `rustc --explain E0282`.
You can’t perform that action at this time.
0 commit comments