-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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)]`
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.