-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-adt_const_params`#![feature(adt_const_params)]``#![feature(adt_const_params)]`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
The following code fails to compile, because using function pointers as const generics is forbidden:
#![feature(const_generics)]
struct A<const F: fn()>;
However, if the function pointer is inside an array, it suddenly compiles:
#![feature(const_generics)]
struct B<const F: [fn(); 1]>;
Is this intentional, or should it also be forbidden?
Warzkos, workingjubilee and orzogc
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-adt_const_params`#![feature(adt_const_params)]``#![feature(adt_const_params)]`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.