1 #![feature(associated_type_bounds)]
2 #![feature(type_alias_impl_trait)]
5 use std::mem::ManuallyDrop;
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]
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]
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]
21 T: Iterator<Item: Copy, Item: Send>,
22 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
28 T: Iterator<Item: Copy, Item: Copy>,
29 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
35 T: Iterator<Item: 'static, Item: 'static>,
36 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
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]
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]
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]
55 T: Iterator<Item: Copy, Item: Send>,
56 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
62 T: Iterator<Item: Copy, Item: Copy>,
63 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
69 T: Iterator<Item: 'static, Item: 'static>,
70 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
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]
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]
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]
89 T: Iterator<Item: Copy, Item: Send>,
90 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
96 T: Iterator<Item: Copy, Item: Copy>,
97 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
103 T: Iterator<Item: 'static, Item: 'static>,
104 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
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]
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]
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]
117 T: Iterator<Item: Copy, Item: Send>,
118 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
123 T: Iterator<Item: Copy, Item: Copy>,
124 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
129 T: Iterator<Item: 'static, Item: 'static>,
130 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
134 fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
137 fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
140 fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
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]
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]
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]
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]
158 T: Iterator<Item: Copy, Item: Send>,
159 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
163 T: Iterator<Item: Copy, Item: Copy>,
164 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
168 T: Iterator<Item: 'static, Item: 'static>,
169 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
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]
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]
199 T: Iterator<Item: Copy, Item: Send>,
200 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
205 T: Iterator<Item: Copy, Item: Copy>,
206 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
211 T: Iterator<Item: 'static, Item: 'static>,
212 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
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]
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]
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]
237 type A: Iterator<Item: Copy, Item: Send>;
238 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
241 type A: Iterator<Item: Copy, Item: Copy>;
242 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
245 type A: Iterator<Item: 'static, Item: 'static>;
246 //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
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]