about summary refs log tree commit diff
path: root/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.rs
blob: 99318ef75984e022a861167fd2c0125f94a6c35e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// regression test for #137813 where we would assume all constants in the type system
// cannot contain inference variables, even though associated const equality syntax
// was still lowered without the feature gate enabled.

trait AssocConst {
    const A: u8;
}

impl<T> AssocConst for (T,) {
    const A: u8 = 0;
}

trait Trait {}

impl<U> Trait for () where (U,): AssocConst<A = { 0 }> {}
//~^ ERROR associated const equality is incomplete
//~| ERROR the type parameter `U` is not constrained by the impl trait

fn foo()
where
    (): Trait,
    //~^ ERROR type mismatch resolving
{
}

fn main() {}