Skip to content

Commit e9d2879

Browse files
authored
Rollup merge of #64921 - JohnTitor:add-test-enum, r=varkor
Add test for issue-64662 Closes #64662 r? @varkor
2 parents 5560f8c + 5bf4397 commit e9d2879

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)