@@ -24,6 +24,31 @@ impl<'a, A: T1> T1 for &'a A {}
2424
2525fn want < V : T1 > ( _x : V ) { }
2626
27+ enum ExampleTuple < T > {
28+ ExampleTupleVariant ( T ) ,
29+ }
30+ use ExampleDifferentTupleVariantName as ExampleYetAnotherTupleVariantName ;
31+ use ExampleTuple as ExampleOtherTuple ;
32+ use ExampleTuple :: ExampleTupleVariant as ExampleDifferentTupleVariantName ;
33+ use ExampleTuple :: * ;
34+
35+ impl < A > T1 for ExampleTuple < A > where A : T3 { }
36+
37+ enum ExampleStruct < T > {
38+ ExampleStructVariant { field : T } ,
39+ }
40+ use ExampleDifferentStructVariantName as ExampleYetAnotherStructVariantName ;
41+ use ExampleStruct as ExampleOtherStruct ;
42+ use ExampleStruct :: ExampleStructVariant as ExampleDifferentStructVariantName ;
43+ use ExampleStruct :: * ;
44+
45+ impl < A > T1 for ExampleStruct < A > where A : T3 { }
46+
47+ struct ExampleActuallyTupleStruct < T > ( T , i32 ) ;
48+ use ExampleActuallyTupleStruct as ExampleActuallyTupleStructOther ;
49+
50+ impl < A > T1 for ExampleActuallyTupleStruct < A > where A : T3 { }
51+
2752fn example < Q > ( q : Q ) {
2853 want ( Wrapper { value : Burrito { filling : q } } ) ;
2954 //~^ ERROR the trait bound `Q: T3` is not satisfied [E0277]
@@ -36,6 +61,42 @@ fn example<Q>(q: Q) {
3661
3762 want ( & Some ( q) ) ;
3863 //~^ ERROR `Q` is not an iterator [E0277]
64+
65+ want ( & ExampleTuple :: ExampleTupleVariant ( q) ) ;
66+ //~^ ERROR `Q: T3` is not satisfied [E0277]
67+
68+ want ( & ExampleTupleVariant ( q) ) ;
69+ //~^ ERROR `Q: T3` is not satisfied [E0277]
70+
71+ want ( & ExampleOtherTuple :: ExampleTupleVariant ( q) ) ;
72+ //~^ ERROR `Q: T3` is not satisfied [E0277]
73+
74+ want ( & ExampleDifferentTupleVariantName ( q) ) ;
75+ //~^ ERROR `Q: T3` is not satisfied [E0277]
76+
77+ want ( & ExampleYetAnotherTupleVariantName ( q) ) ;
78+ //~^ ERROR `Q: T3` is not satisfied [E0277]
79+
80+ want ( & ExampleStruct :: ExampleStructVariant { field : q } ) ;
81+ //~^ ERROR `Q: T3` is not satisfied [E0277]
82+
83+ want ( & ExampleStructVariant { field : q } ) ;
84+ //~^ ERROR `Q: T3` is not satisfied [E0277]
85+
86+ want ( & ExampleOtherStruct :: ExampleStructVariant { field : q } ) ;
87+ //~^ ERROR `Q: T3` is not satisfied [E0277]
88+
89+ want ( & ExampleDifferentStructVariantName { field : q } ) ;
90+ //~^ ERROR `Q: T3` is not satisfied [E0277]
91+
92+ want ( & ExampleYetAnotherStructVariantName { field : q } ) ;
93+ //~^ ERROR `Q: T3` is not satisfied [E0277]
94+
95+ want ( & ExampleActuallyTupleStruct ( q, 0 ) ) ;
96+ //~^ ERROR `Q: T3` is not satisfied [E0277]
97+
98+ want ( & ExampleActuallyTupleStructOther ( q, 0 ) ) ;
99+ //~^ ERROR `Q: T3` is not satisfied [E0277]
39100}
40101
41102fn main ( ) { }
0 commit comments