Add test that caused query cycle with unevaluated const

This commit is contained in:
tiif 2025-11-08 15:55:01 +00:00
parent c5dabe8cf7
commit eef8a023d2

View file

@ -0,0 +1,20 @@
//@ compile-flags: -Znext-solver
//@ check-pass
// Regression test for https://github.com/rust-lang/trait-system-refactor-initiative/issues/249
const CONST: &str = "hi";
trait ToUnit {
type Assoc;
}
impl<T> ToUnit for T {
type Assoc = ();
}
fn foo()
where
<[u8; CONST.len()] as ToUnit>::Assoc: Sized,
{}
fn main(){}