#![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 [+, +] t: T, u: U } #[rustc_variance] enum TestEnum> { //~ ERROR [*, +] //~^ ERROR: `U` is never used Foo(T) } #[rustc_variance] struct TestContraStruct> { //~ ERROR [*, +] //~^ ERROR: `U` is never used t: T } #[rustc_variance] struct TestBox+Setter> { //~ ERROR [*, +] //~^ ERROR: `U` is never used t: T } pub fn main() { }