Closed
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.