about summary refs log tree commit diff
path: root/tests/ui/const-generics/associated_const_equality/equality_bound_with_infer.rs
blob: dc42e00c2e83438a8cda04a979bc1f2eb758831d (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
#![feature(associated_const_equality, generic_const_items)]
#![expect(incomplete_features)]

// Regression test for #133066 where we would try to evaluate `<() as Foo>::ASSOC<_>` even
// though it contained inference variables, which would cause ICEs.

trait Foo {
    const ASSOC<const N: u32>: u32;
}

impl Foo for () {
    const ASSOC<const N: u32>: u32 = N;
}

fn bar<const N: u32, T: Foo<ASSOC<N> = 10>>() {}

fn main() {
    bar::<_, ()>();
    //~^ ERROR: type mismatch resolving `<() as Foo>::ASSOC<_> == 10`

    // FIXME(mgca):
    // FIXME(associated_const_equality):
    // This ought to start compiling once const items are aliases rather than bodies
}