Add test that caused query cycle with unevaluated const
This commit is contained in:
parent
c5dabe8cf7
commit
eef8a023d2
1 changed files with 20 additions and 0 deletions
20
tests/ui/traits/next-solver/unevaluated_const_query_cycle.rs
Normal file
20
tests/ui/traits/next-solver/unevaluated_const_query_cycle.rs
Normal 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(){}
|
||||
Loading…
Add table
Add a link
Reference in a new issue