summaryrefslogtreecommitdiffstats
path: root/tests/ui/variance/variance-associated-consts.rs
blob: da55bc96244f2d0c5b1802348969354f9ff1ae38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Test that the variance computation considers types that
// appear in const expressions to be invariant.

#![feature(rustc_attrs)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

trait Trait {
    const Const: usize;
}

#[rustc_variance]
struct Foo<T: Trait> { //~ ERROR [o]
    field: [u8; <T as Trait>::Const]
}

fn main() { }