Skip to content

Commit b5e1ac7

Browse files
committed
add regression test for #90871
1 parent 1f5d8d4 commit b5e1ac7

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Diff for: src/test/ui/closures/issue-90871.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
2: n([u8; || 1])
3+
//~^ ERROR cannot find type `n` in this scope
4+
//~| ERROR mismatched types
5+
}

Diff for: src/test/ui/closures/issue-90871.stderr

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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`.

0 commit comments

Comments
 (0)