Fix ICE with const generic param in struct

This commit is contained in:
varkor
2019-03-22 01:49:42 +00:00
parent 7a4df3b53d
commit f94f85bebd
3 changed files with 48 additions and 17 deletions

View File

@@ -0,0 +1,6 @@
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
struct S<const C: u8>(C); //~ ERROR expected type, found const parameter
fn main() {}

View File

@@ -0,0 +1,15 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> $DIR/struct-with-invalid-const-param.rs:1:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^
error[E0573]: expected type, found const parameter `C`
--> $DIR/struct-with-invalid-const-param.rs:4:23
|
LL | struct S<const C: u8>(C);
| ^ help: a struct with a similar name exists: `S`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0573`.