summaryrefslogtreecommitdiffstats
path: root/src/test/ui/variance/variance-object-types.rs
blob: 6ded24cd1e9ed497de00df0f16925171e91b0bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#![feature(rustc_attrs)]


// For better or worse, associated types are invariant, and hence we
// get an invariant result for `'a`.
#[rustc_variance]
struct Foo<'a> { //~ ERROR [o]
    x: Box<dyn Fn(i32) -> &'a i32 + 'static>
}

fn main() {
}