Skip to content

Commit 5bf4397

Browse files
committed
Add test for issue-64662
1 parent e0436d9 commit 5bf4397

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/test/ui/consts/issue-64662.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
enum Foo {
2+
A = foo(), //~ ERROR: type annotations needed
3+
B = foo(), //~ ERROR: type annotations needed
4+
}
5+
6+
const fn foo<T>() -> isize {
7+
0
8+
}
9+
10+
fn main() {}

src/test/ui/consts/issue-64662.stderr

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/issue-64662.rs:2:9
3+
|
4+
LL | A = foo(),
5+
| ^^^ cannot infer type for `T`
6+
7+
error[E0282]: type annotations needed
8+
--> $DIR/issue-64662.rs:3:9
9+
|
10+
LL | B = foo(),
11+
| ^^^ cannot infer type for `T`
12+
13+
error: aborting due to 2 previous errors
14+
15+
For more information about this error, try `rustc --explain E0282`.

0 commit comments

Comments
 (0)