Closed
Description
I expect the code below code to compile, but it fails. const_generics
should allow more than just the types whitelisted in min_const_generics
, but it seems rustc only looks at the min_const_generics
flag in this case.
#![feature(const_generics)]
#![feature(min_const_generics)]
struct Contain<const S: &'static [u8]>;
The error message is:
error: `&'static [u8]` is forbidden as the type of a const generic parameter
--> src/lib.rs:4:25
|
4 | struct Contain<const S: &'static [u8]>;
| ^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
= note: more complex types are supported with `#[feature(const_generics)]`