trait T1 {} trait T2 {} trait T3 {} trait T4 {} impl T1 for Wrapper {} impl T2 for i32 {} impl T3 for i32 {} impl T2 for Burrito {} struct Wrapper { value: W, } struct Burrito { filling: F, } impl T1 for Option {} impl<'a, A: T1> T1 for &'a A {} fn want(_x: V) {} enum ExampleTuple { ExampleTupleVariant(T), } use ExampleDifferentTupleVariantName as ExampleYetAnotherTupleVariantName; use ExampleTuple as ExampleOtherTuple; use ExampleTuple::ExampleTupleVariant as ExampleDifferentTupleVariantName; use ExampleTuple::*; impl T1 for ExampleTuple where A: T3 {} enum ExampleStruct { ExampleStructVariant { field: T }, } use ExampleDifferentStructVariantName as ExampleYetAnotherStructVariantName; use ExampleStruct as ExampleOtherStruct; use ExampleStruct::ExampleStructVariant as ExampleDifferentStructVariantName; use ExampleStruct::*; impl T1 for ExampleStruct where A: T3 {} struct ExampleActuallyTupleStruct(T, i32); use ExampleActuallyTupleStruct as ExampleActuallyTupleStructOther; impl T1 for ExampleActuallyTupleStruct where A: T3 {} fn example(q: Q) { want(Wrapper { value: Burrito { filling: q } }); //~^ ERROR the trait bound `Q: T3` is not satisfied [E0277] want(Some(())); //~^ ERROR `()` is not an iterator [E0277] want(Some(q)); //~^ ERROR `Q` is not an iterator [E0277] want(&Some(q)); //~^ ERROR `Q` is not an iterator [E0277] want(&ExampleTuple::ExampleTupleVariant(q)); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleTupleVariant(q)); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleOtherTuple::ExampleTupleVariant(q)); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleDifferentTupleVariantName(q)); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleYetAnotherTupleVariantName(q)); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleStruct::ExampleStructVariant { field: q }); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleStructVariant { field: q }); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleOtherStruct::ExampleStructVariant { field: q }); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleDifferentStructVariantName { field: q }); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleYetAnotherStructVariantName { field: q }); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleActuallyTupleStruct(q, 0)); //~^ ERROR `Q: T3` is not satisfied [E0277] want(&ExampleActuallyTupleStructOther(q, 0)); //~^ ERROR `Q: T3` is not satisfied [E0277] } fn main() {}