]>
git.proxmox.com Git - rustc.git/blob - tests/ui/const-generics/occurs-check/unused-substs-2.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
4 // The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
6 // If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an
7 // artificial inference cycle.
8 struct Foo
<const N
: usize>;
11 fn bind() -> (T
, Self);
14 // `N` has to be `ConstKind::Unevaluated`.
15 impl<T
> Bind
<T
> for Foo
<{ 6 + 1 }
> {
16 fn bind() -> (T
, Self) {
22 let (mut t
, foo
) = Foo
::bind();
23 // `t` is `ty::Infer(TyVar(_#1t))`
24 // `foo` contains `ty::Infer(TyVar(_#1t))` in its substs
26 //~^ ERROR mismatched types