You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Post lazy normalization for consts cleanup (#71973) #72129
Add src/test/ui/const-generics/issues/issue-69654.rs back in, which causes an unrelated stack overflow once lazy normalization is enabled.
#![feature(const_generics)]#![allow(incomplete_features)]traitBar<T>{}impl<T>Bar<T>for[u8;T]{}//~^ ERROR expected value, found type parameter `T`structFoo<constN:usize>{}impl<constN:usize>Foo<N>where[u8;N]:Bar<[();N]>,{fnfoo(){}}fnmain(){Foo::foo();}
Also add the following similar test, which should compile but also causes a stack overflow.
// run-pass#![feature(const_generics)]#![feature(lazy_normalization_consts)]#![allow(incomplete_features)]// try to devise a test for higher-ranked case//// e.g., for<'a> EqZero<<() as Zero<'a>::C>>////traitEqZero<constC:usize>{}implEqZero<0>for(){}traitZero<'a>{constC:usize;}impl<'a>Zero<'a>for(){constC:usize = 0;}fntest_me<T>()wherefor<'a>T:EqZero<{<()asZero<'a>>::C}>{}fnmain(){test_me::<()>();}
However, that test continues to ICE even with these changes, due to some assertion in type checking. So maybe it's fine, and we should just move that test to a follow-up issue. Anyway, this code as it is written here is the code we want eventually -- we just have to reconcile some details of the leak-check first.
Activity
lcnr commentedon May 12, 2020
done
Add
src/test/ui/const-generics/issues/issue-69654.rsback in, which causes an unrelated stack overflow once lazy normalization is enabled.Also add the following similar test, which should compile but also causes a stack overflow.
lcnr commentedon May 12, 2020
Taken from a comment by @nikomatsakis
varkor commentedon Oct 2, 2020
Linking the relevant Zulip conversation here, which is helpful.
lcnr commentedon Jun 24, 2022
the remaining work is tracked in different issues, most notably rust-lang/project-const-generics#35