diff --git a/tests/ui/traits/next-solver/unevaluated_const_query_cycle.rs b/tests/ui/traits/next-solver/unevaluated_const_query_cycle.rs new file mode 100644 index 000000000000..be7024dcbf18 --- /dev/null +++ b/tests/ui/traits/next-solver/unevaluated_const_query_cycle.rs @@ -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 ToUnit for T { + type Assoc = (); +} + +fn foo() +where + <[u8; CONST.len()] as ToUnit>::Assoc: Sized, +{} + +fn main(){}