-
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)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.
Description
Consider this example:
#![feature(const_generics)]
fn foo<const N: usize, const A: [u8; N]>() {}
fn bar() {
foo::<1, {[1]}>();
}
It causes a cycle error:
error[E0391]: cycle detected when processing `foo::A`
--> $DIR/issue-62879.rs:4:30
|
LL | fn foo<const N: usize, const A: [u8; N]>() {}
| ^
|
= note: ...which again requires processing `foo::A`, completing the cycle
note: cycle used when processing `foo`
--> $DIR/issue-62879.rs:4:1
|
LL | fn foo<const N: usize, const A: [u8; N]>() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It should be compiled, but cycle error occurs due to a lack of lazy normalization.
It's added to ui test as a regression test of #62879 (src/test/ui/const-generics/issue-62879.rs) in #68236, but we should still improve current behavior.
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.