blob: 00e5338880a140552810f59df1f51dc8d9125fce [file]
// Test that the variance computation considers types/regions that
// appear in projections to be invariant.
#![feature(rustc_attrs)]
trait Trait<'a> {
type Type;
fn method(&'a self) { }
}
#[rustc_dump_variances]
struct Foo<'a, T : Trait<'a>> { //~ ERROR ['a: +, T: +]
field: (T, &'a ())
}
#[rustc_dump_variances]
struct Bar<'a, T : Trait<'a>> { //~ ERROR ['a: o, T: o]
field: <T as Trait<'a>>::Type
}
fn main() { }