#![allow(dead_code)] #![feature(rustc_attrs)] // Check that bounds on type parameters (other than `Self`) do not // influence variance. trait Getter { fn get(&self) -> T; } trait Setter { fn get(&self, _: T); } #[rustc_variance] struct TestStruct> { //~ ERROR [U: +, T: +] t: T, u: U } #[rustc_variance] enum TestEnum> { //~ ERROR [U: *, T: +] //~^ ERROR: `U` is never used Foo(T) } #[rustc_variance] struct TestContraStruct> { //~ ERROR [U: *, T: +] //~^ ERROR: `U` is never used t: T } #[rustc_variance] struct TestBox+Setter> { //~ ERROR [U: *, T: +] //~^ ERROR: `U` is never used t: T } pub fn main() { }