-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)C-bugCategory: This is a bug.Category: This is a bug.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.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
The following should type check but does not:
#![feature(const_generics)]
fn foo<const N: usize, const A: [u8; N]>() {}
fn bar() {
foo::<_, {[1]}>();
}
Errors with:
error[E0107]: wrong number of const arguments: expected 2, found 1
--> src/lib.rs:6:5
|
6 | foo::<_, {[1]}>();
| ^^^^^^^^^^^^^^^ expected 2 const arguments
error[E0107]: wrong number of type arguments: expected 0, found 1
--> src/lib.rs:6:11
|
6 | foo::<_, {[1]}>();
| ^ unexpected type argument
error[E0308]: mismatched types
--> src/lib.rs:6:15
|
6 | foo::<_, {[1]}>();
| ^^^ expected usize, found array of 1 elements
|
= note: expected type `usize`
found type `[{integer}; 1]`
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)Area: Lazy normalization (tracking issue: #60471)C-bugCategory: This is a bug.Category: This is a bug.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.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.