File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ fn main ( ) {
2+ 2 : n ( [ u8; || 1 ] )
3+ //~^ ERROR cannot find type `n` in this scope
4+ //~| ERROR mismatched types
5+ }
Original file line number Diff line number Diff line change 1+ error[E0412]: cannot find type `n` in this scope
2+ --> $DIR/issue-90871.rs:2:8
3+ |
4+ LL | 2: n([u8; || 1])
5+ | ^ expecting a type here because of type ascription
6+
7+ error[E0308]: mismatched types
8+ --> $DIR/issue-90871.rs:2:15
9+ |
10+ LL | 2: n([u8; || 1])
11+ | ^^^^ expected `usize`, found closure
12+ |
13+ = note: expected type `usize`
14+ found closure `[closure@$DIR/issue-90871.rs:2:15: 2:17]`
15+ help: use parentheses to call this closure
16+ |
17+ LL | 2: n([u8; (|| 1)()])
18+ | + +++
19+
20+ error: aborting due to 2 previous errors
21+
22+ Some errors have detailed explanations: E0308, E0412.
23+ For more information about an error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments