]>
Commit | Line | Data |
---|---|---|
dc9dc135 | 1 | // ignore-tidy-linelength |
dc9dc135 XL |
2 | |
3 | #![feature(associated_type_bounds)] | |
416331ca | 4 | #![feature(type_alias_impl_trait)] |
e1599b0c | 5 | #![feature(impl_trait_in_bindings)] //~ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash [incomplete_features] |
dc9dc135 XL |
6 | #![feature(untagged_unions)] |
7 | ||
8 | use std::iter; | |
9 | ||
10 | struct SI1<T: Iterator<Item: Copy, Item: Send>> { f: T } | |
dfeec247 | 11 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 12 | struct SI2<T: Iterator<Item: Copy, Item: Copy>> { f: T } |
dfeec247 | 13 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 14 | struct SI3<T: Iterator<Item: 'static, Item: 'static>> { f: T } |
dfeec247 | 15 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 16 | struct SW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T } |
dfeec247 | 17 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 18 | struct SW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T } |
dfeec247 | 19 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 20 | struct SW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T } |
dfeec247 | 21 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
22 | |
23 | enum EI1<T: Iterator<Item: Copy, Item: Send>> { V(T) } | |
dfeec247 | 24 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 25 | enum EI2<T: Iterator<Item: Copy, Item: Copy>> { V(T) } |
dfeec247 | 26 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 27 | enum EI3<T: Iterator<Item: 'static, Item: 'static>> { V(T) } |
dfeec247 | 28 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 29 | enum EW1<T> where T: Iterator<Item: Copy, Item: Send> { V(T) } |
dfeec247 | 30 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 31 | enum EW2<T> where T: Iterator<Item: Copy, Item: Copy> { V(T) } |
dfeec247 | 32 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 33 | enum EW3<T> where T: Iterator<Item: 'static, Item: 'static> { V(T) } |
dfeec247 | 34 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
35 | |
36 | union UI1<T: Iterator<Item: Copy, Item: Send>> { f: T } | |
dfeec247 | 37 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 38 | union UI2<T: Iterator<Item: Copy, Item: Copy>> { f: T } |
dfeec247 | 39 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 40 | union UI3<T: Iterator<Item: 'static, Item: 'static>> { f: T } |
dfeec247 | 41 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 42 | union UW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T } |
dfeec247 | 43 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 44 | union UW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T } |
dfeec247 | 45 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 46 | union UW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T } |
dfeec247 | 47 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
48 | |
49 | fn FI1<T: Iterator<Item: Copy, Item: Send>>() {} | |
dfeec247 | 50 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 51 | fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {} |
dfeec247 | 52 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 53 | fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {} |
dfeec247 | 54 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 55 | fn FW1<T>() where T: Iterator<Item: Copy, Item: Send> {} |
dfeec247 | 56 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 57 | fn FW2<T>() where T: Iterator<Item: Copy, Item: Copy> {} |
dfeec247 | 58 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 59 | fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {} |
dfeec247 | 60 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
61 | |
62 | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() } | |
dfeec247 | 63 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 64 | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() } |
dfeec247 | 65 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 66 | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() } |
dfeec247 | 67 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 68 | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {} |
dfeec247 | 69 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 70 | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {} |
dfeec247 | 71 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 72 | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {} |
dfeec247 | 73 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
74 | |
75 | const CIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); | |
dfeec247 | 76 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 77 | const CIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); |
dfeec247 | 78 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 79 | const CIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); |
dfeec247 | 80 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 81 | static SIT1: impl Iterator<Item: Copy, Item: Send> = iter::empty(); |
dfeec247 | 82 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 83 | static SIT2: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); |
dfeec247 | 84 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 85 | static SIT3: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); |
dfeec247 | 86 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
87 | |
88 | fn lit1() { let _: impl Iterator<Item: Copy, Item: Send> = iter::empty(); } | |
dfeec247 | 89 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 90 | fn lit2() { let _: impl Iterator<Item: Copy, Item: Copy> = iter::empty(); } |
dfeec247 | 91 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 92 | fn lit3() { let _: impl Iterator<Item: 'static, Item: 'static> = iter::empty(); } |
dfeec247 | 93 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
94 | |
95 | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T; | |
dfeec247 | 96 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 97 | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T; |
dfeec247 | 98 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 99 | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T; |
dfeec247 | 100 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 101 | type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T; |
dfeec247 | 102 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 103 | type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T; |
dfeec247 | 104 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 105 | type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T; |
dfeec247 | 106 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 107 | |
416331ca | 108 | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; |
dfeec247 | 109 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
110 | //~| ERROR could not find defining uses |
111 | //~| ERROR could not find defining uses | |
112 | //~| ERROR could not find defining uses | |
416331ca | 113 | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy; |
dfeec247 | 114 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
115 | //~| ERROR could not find defining uses |
116 | //~| ERROR could not find defining uses | |
117 | //~| ERROR could not find defining uses | |
416331ca | 118 | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; |
dfeec247 | 119 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
120 | //~| ERROR could not find defining uses |
121 | //~| ERROR could not find defining uses | |
122 | //~| ERROR could not find defining uses | |
416331ca | 123 | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; |
dfeec247 | 124 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
125 | //~| ERROR could not find defining uses |
126 | //~| ERROR could not find defining uses | |
127 | //~| ERROR could not find defining uses | |
416331ca | 128 | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; |
dfeec247 | 129 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
130 | //~| ERROR could not find defining uses |
131 | //~| ERROR could not find defining uses | |
132 | //~| ERROR could not find defining uses | |
416331ca | 133 | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; |
dfeec247 | 134 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
135 | //~| ERROR could not find defining uses |
136 | //~| ERROR could not find defining uses | |
137 | //~| ERROR could not find defining uses | |
dc9dc135 XL |
138 | |
139 | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} | |
dfeec247 | 140 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 141 | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {} |
dfeec247 | 142 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 143 | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {} |
dfeec247 | 144 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 145 | trait TRS1: Iterator<Item: Copy, Item: Send> {} |
dfeec247 | 146 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 147 | trait TRS2: Iterator<Item: Copy, Item: Copy> {} |
dfeec247 | 148 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 149 | trait TRS3: Iterator<Item: 'static, Item: 'static> {} |
dfeec247 | 150 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 151 | trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {} |
dfeec247 | 152 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 153 | trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {} |
dfeec247 | 154 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 155 | trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {} |
dfeec247 | 156 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 157 | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {} |
dfeec247 XL |
158 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
159 | //~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] | |
dc9dc135 | 160 | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {} |
dfeec247 XL |
161 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
162 | //~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] | |
dc9dc135 | 163 | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {} |
dfeec247 XL |
164 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
165 | //~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] | |
dc9dc135 | 166 | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; } |
dfeec247 | 167 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 168 | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; } |
dfeec247 | 169 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 | 170 | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; } |
dfeec247 | 171 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
dc9dc135 XL |
172 | |
173 | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>; | |
dfeec247 | 174 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
175 | //~| ERROR could not find defining uses |
176 | //~| ERROR could not find defining uses | |
dc9dc135 | 177 | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>; |
dfeec247 | 178 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
179 | //~| ERROR could not find defining uses |
180 | //~| ERROR could not find defining uses | |
dc9dc135 | 181 | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>; |
dfeec247 | 182 | //~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719] |
e1599b0c XL |
183 | //~| ERROR could not find defining uses |
184 | //~| ERROR could not find defining uses | |
dc9dc135 XL |
185 | |
186 | fn main() {} |