Rollup merge of #64921 - JohnTitor:add-test-enum, r=varkor

Add test for issue-64662

Closes #64662
r? @varkor
This commit is contained in:
Tyler Mandry 2019-09-30 14:38:31 -07:00 committed by GitHub
commit e9d28796ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,10 @@
enum Foo {
A = foo(), //~ ERROR: type annotations needed
B = foo(), //~ ERROR: type annotations needed
}
const fn foo<T>() -> isize {
0
}
fn main() {}

View File

@ -0,0 +1,15 @@
error[E0282]: type annotations needed
--> $DIR/issue-64662.rs:2:9
|
LL | A = foo(),
| ^^^ cannot infer type for `T`
error[E0282]: type annotations needed
--> $DIR/issue-64662.rs:3:9
|
LL | B = foo(),
| ^^^ cannot infer type for `T`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0282`.