1 #![feature(associated_type_bounds)]
2 #![feature(type_alias_impl_trait)]
3 #![feature(untagged_unions)]
4
5 use std::iter;
6
7 struct SI1<T: Iterator<Item: Copy, Item: Send>> {
8 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
9 f: T,
10 }
11 struct SI2<T: Iterator<Item: Copy, Item: Copy>> {
12 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
13 f: T,
14 }
15 struct SI3<T: Iterator<Item: 'static, Item: 'static>> {
16 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
17 f: T,
18 }
19 struct SW1<T>
20 where
21 T: Iterator<Item: Copy, Item: Send>,
22 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
23 {
24 f: T,
25 }
26 struct SW2<T>
27 where
28 T: Iterator<Item: Copy, Item: Copy>,
29 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
30 {
31 f: T,
32 }
33 struct SW3<T>
34 where
35 T: Iterator<Item: 'static, Item: 'static>,
36 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
37 {
38 f: T,
39 }
40
41 enum EI1<T: Iterator<Item: Copy, Item: Send>> {
42 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
43 V(T),
44 }
45 enum EI2<T: Iterator<Item: Copy, Item: Copy>> {
46 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
47 V(T),
48 }
49 enum EI3<T: Iterator<Item: 'static, Item: 'static>> {
50 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
51 V(T),
52 }
53 enum EW1<T>
54 where
55 T: Iterator<Item: Copy, Item: Send>,
56 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
57 {
58 V(T),
59 }
60 enum EW2<T>
61 where
62 T: Iterator<Item: Copy, Item: Copy>,
63 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
64 {
65 V(T),
66 }
67 enum EW3<T>
68 where
69 T: Iterator<Item: 'static, Item: 'static>,
70 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
71 {
72 V(T),
73 }
74
75 union UI1<T: Iterator<Item: Copy, Item: Send>> {
76 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
77 f: T,
78 }
79 union UI2<T: Iterator<Item: Copy, Item: Copy>> {
80 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
81 f: T,
82 }
83 union UI3<T: Iterator<Item: 'static, Item: 'static>> {
84 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
85 f: T,
86 }
87 union UW1<T>
88 where
89 T: Iterator<Item: Copy, Item: Send>,
90 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
91 {
92 f: T,
93 }
94 union UW2<T>
95 where
96 T: Iterator<Item: Copy, Item: Copy>,
97 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
98 {
99 f: T,
100 }
101 union UW3<T>
102 where
103 T: Iterator<Item: 'static, Item: 'static>,
104 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
105 {
106 f: T,
107 }
108
FI1<T: Iterator<Item: Copy, Item: Send>>()109 fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
110 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
FI2<T: Iterator<Item: Copy, Item: Copy>>()111 fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
112 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
FI3<T: Iterator<Item: 'static, Item: 'static>>()113 fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
114 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
FW1<T>() where T: Iterator<Item: Copy, Item: Send>,115 fn FW1<T>()
116 where
117 T: Iterator<Item: Copy, Item: Send>,
118 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
119 {
120 }
FW2<T>() where T: Iterator<Item: Copy, Item: Copy>,121 fn FW2<T>()
122 where
123 T: Iterator<Item: Copy, Item: Copy>,
124 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
125 {
126 }
FW3<T>() where T: Iterator<Item: 'static, Item: 'static>,127 fn FW3<T>()
128 where
129 T: Iterator<Item: 'static, Item: 'static>,
130 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
131 {
132 }
133
FRPIT1() -> impl Iterator<Item: Copy, Item: Send>134 fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
135 iter::empty()
136 }
FRPIT2() -> impl Iterator<Item: Copy, Item: Copy>137 fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
138 iter::empty()
139 }
FRPIT3() -> impl Iterator<Item: 'static, Item: 'static>140 fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
141 iter::empty()
142 }
FAPIT1(_: impl Iterator<Item: Copy, Item: Send>)143 fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
144 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>)145 fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
146 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>)147 fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
148 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
149
150 type TAI1<T: Iterator<Item: Copy, Item: Send>> = T;
151 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
152 type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
153 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
154 type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
155 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
156 type TAW1<T>
157 where
158 T: Iterator<Item: Copy, Item: Send>,
159 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
160 = T;
161 type TAW2<T>
162 where
163 T: Iterator<Item: Copy, Item: Copy>,
164 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
165 = T;
166 type TAW3<T>
167 where
168 T: Iterator<Item: 'static, Item: 'static>,
169 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
170 = T;
171
172 type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
173 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
174 type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
175 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
176 type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
177 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
178 type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
179 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
180 type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
181 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
182 type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
183 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
184
185 trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
186 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
187 trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
188 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
189 trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
190 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
191 trait TRS1: Iterator<Item: Copy, Item: Send> {}
192 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
193 trait TRS2: Iterator<Item: Copy, Item: Copy> {}
194 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
195 trait TRS3: Iterator<Item: 'static, Item: 'static> {}
196 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
197 trait TRW1<T>
198 where
199 T: Iterator<Item: Copy, Item: Send>,
200 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
201 {
202 }
203 trait TRW2<T>
204 where
205 T: Iterator<Item: Copy, Item: Copy>,
206 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
207 {
208 }
209 trait TRW3<T>
210 where
211 T: Iterator<Item: 'static, Item: 'static>,
212 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
213 {
214 }
215 trait TRSW1
216 where
217 Self: Iterator<Item: Copy, Item: Send>,
218 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
219 //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
220 {
221 }
222 trait TRSW2
223 where
224 Self: Iterator<Item: Copy, Item: Copy>,
225 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
226 //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
227 {
228 }
229 trait TRSW3
230 where
231 Self: Iterator<Item: 'static, Item: 'static>,
232 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
233 //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
234 {
235 }
236 trait TRA1 {
237 type A: Iterator<Item: Copy, Item: Send>;
238 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
239 }
240 trait TRA2 {
241 type A: Iterator<Item: Copy, Item: Copy>;
242 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
243 }
244 trait TRA3 {
245 type A: Iterator<Item: 'static, Item: 'static>;
246 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
247 }
248
249 type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
250 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
251 type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
252 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
253 type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
254 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
255
main()256 fn main() {}
257