@@ -24,6 +24,31 @@ impl<'a, A: T1> T1 for &'a A {}
24
24
25
25
fn want < V : T1 > ( _x : V ) { }
26
26
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
+
27
52
fn example < Q > ( q : Q ) {
28
53
want ( Wrapper { value : Burrito { filling : q } } ) ;
29
54
//~^ ERROR the trait bound `Q: T3` is not satisfied [E0277]
@@ -36,6 +61,42 @@ fn example<Q>(q: Q) {
36
61
37
62
want ( & Some ( q) ) ;
38
63
//~^ 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]
39
100
}
40
101
41
102
fn main ( ) { }
0 commit comments