summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-type-bounds/const-projection-err.rs
blob: bead85630016b7514897e3faecfc31a20b7456cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// revisions: stock gce

#![feature(associated_const_equality)]
#![cfg_attr(gce, feature(generic_const_exprs))]
//[gce]~^ WARN the feature `generic_const_exprs` is incomplete

trait TraitWAssocConst {
    const A: usize;
}

fn foo<T: TraitWAssocConst<A = 1>>() {}

fn bar<T: TraitWAssocConst<A = 0>>() {
    foo::<T>();
    //~^ ERROR type mismatch resolving `<T as TraitWAssocConst>::A == 1`
}

fn main() {}