Fix ICE with const generic param in struct
This commit is contained in:
@@ -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() {}
|
||||
@@ -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`.
|
||||
Reference in New Issue
Block a user