]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/occurs-check/unused-substs-3.rs
Rollup merge of #106661 - mjguzik:linux_statx, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / occurs-check / unused-substs-3.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3
4 // The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
5 //
6 // If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an
7 // artificial inference cycle.
8 fn bind<T>() -> (T, [u8; 6 + 1]) {
9     todo!()
10 }
11
12 fn main() {
13     let (mut t, foo) = bind();
14     // `t` is `ty::Infer(TyVar(_#1t))`
15     // `foo` contains `ty::Infer(TyVar(_#1t))` in its substs
16     t = foo;
17     //~^ ERROR mismatched types
18     //~| NOTE cyclic type
19 }