]>
Commit | Line | Data |
---|---|---|
c30ab7b3 SL |
1 | // This test case tests the incremental compilation hash (ICH) implementation |
2 | // for trait definitions. | |
3 | ||
4 | // The general pattern followed here is: Change one thing between rev1 and rev2 | |
5 | // and make sure that the hash has changed, then change nothing between rev2 and | |
6 | // rev3 and make sure that the hash has not changed. | |
7 | ||
8 | // We also test the ICH for trait definitions exported in metadata. Same as | |
9 | // above, we want to make sure that the change between rev1 and rev2 also | |
10 | // results in a change of the ICH for the trait's metadata, and that it stays | |
11 | // the same between rev2 and rev3. | |
12 | ||
416331ca | 13 | // build-pass (FIXME(62277): could be check-pass?) |
c295e0f8 | 14 | // revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6 |
923072b8 | 15 | // compile-flags: -Z query-dep-graph -O |
c295e0f8 XL |
16 | // [cfail1]compile-flags: -Zincremental-ignore-spans |
17 | // [cfail2]compile-flags: -Zincremental-ignore-spans | |
18 | // [cfail3]compile-flags: -Zincremental-ignore-spans | |
c30ab7b3 SL |
19 | |
20 | #![allow(warnings)] | |
21 | #![feature(rustc_attrs)] | |
22 | #![crate_type="rlib"] | |
23 | #![feature(associated_type_defaults)] | |
c30ab7b3 SL |
24 | |
25 | ||
e1599b0c | 26 | // Change trait visibility |
c295e0f8 | 27 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
28 | trait TraitVisibility { } |
29 | ||
c295e0f8 | 30 | #[cfg(not(any(cfail1,cfail4)))] |
04454e1e | 31 | #[rustc_clean(cfg="cfail2")] |
17df50a5 | 32 | #[rustc_clean(cfg="cfail3")] |
04454e1e | 33 | #[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes")] |
c295e0f8 | 34 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
35 | pub trait TraitVisibility { } |
36 | ||
37 | ||
38 | ||
e1599b0c | 39 | // Change trait unsafety |
c295e0f8 | 40 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
41 | trait TraitUnsafety { } |
42 | ||
c295e0f8 | 43 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 44 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 45 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 46 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 47 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
48 | unsafe trait TraitUnsafety { } |
49 | ||
50 | ||
51 | ||
e1599b0c | 52 | // Add method |
c295e0f8 | 53 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
54 | trait TraitAddMethod { |
55 | } | |
56 | ||
c295e0f8 | 57 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 58 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 59 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 60 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 61 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
62 | pub trait TraitAddMethod { |
63 | fn method(); | |
64 | } | |
65 | ||
66 | ||
67 | ||
e1599b0c | 68 | // Change name of method |
c295e0f8 | 69 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
70 | trait TraitChangeMethodName { |
71 | fn method(); | |
72 | } | |
73 | ||
c295e0f8 | 74 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 75 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 76 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 77 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 78 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
79 | trait TraitChangeMethodName { |
80 | fn methodChanged(); | |
81 | } | |
82 | ||
83 | ||
84 | ||
e1599b0c | 85 | // Add return type to method |
c295e0f8 | 86 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 87 | trait TraitAddReturnType { |
5099ac24 | 88 | //--------------------------------------------------------------------- |
c295e0f8 | 89 | //-------------------------- |
5099ac24 | 90 | //--------------------------------------------------------------------- |
c295e0f8 XL |
91 | //-------------------------- |
92 | fn method() ; | |
c30ab7b3 SL |
93 | } |
94 | ||
c295e0f8 | 95 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
96 | #[rustc_clean(cfg="cfail2")] |
97 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
98 | #[rustc_clean(cfg="cfail5")] |
99 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 100 | trait TraitAddReturnType { |
5099ac24 | 101 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 102 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 103 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 104 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
105 | fn method() -> u32; |
106 | } | |
107 | ||
108 | ||
109 | ||
e1599b0c | 110 | // Change return type of method |
c295e0f8 | 111 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 112 | trait TraitChangeReturnType { |
c295e0f8 XL |
113 | // -------------------------------------------------------------------- |
114 | // ------------------------- | |
115 | // -------------------------------------------------------------------- | |
116 | // ------------------------- | |
c30ab7b3 SL |
117 | fn method() -> u32; |
118 | } | |
119 | ||
c295e0f8 | 120 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
121 | #[rustc_clean(cfg="cfail2")] |
122 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
123 | #[rustc_clean(cfg="cfail5")] |
124 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 125 | trait TraitChangeReturnType { |
17df50a5 XL |
126 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
127 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
128 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
129 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
130 | fn method() -> u64; |
131 | } | |
132 | ||
133 | ||
134 | ||
e1599b0c | 135 | // Add parameter to method |
c295e0f8 | 136 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 137 | trait TraitAddParameterToMethod { |
5099ac24 | 138 | // -------------------------------------------------------------------- |
c295e0f8 | 139 | // ------------------------- |
5099ac24 | 140 | // -------------------------------------------------------------------- |
c295e0f8 XL |
141 | // ------------------------- |
142 | fn method( ); | |
c30ab7b3 SL |
143 | } |
144 | ||
c295e0f8 | 145 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
146 | #[rustc_clean(cfg="cfail2")] |
147 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
148 | #[rustc_clean(cfg="cfail5")] |
149 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 150 | trait TraitAddParameterToMethod { |
5099ac24 | 151 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 152 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 153 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 154 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
155 | fn method(a: u32); |
156 | } | |
157 | ||
158 | ||
159 | ||
e1599b0c | 160 | // Change name of method parameter |
c295e0f8 | 161 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 162 | trait TraitChangeMethodParameterName { |
c295e0f8 | 163 | //------------------------------------------------------ |
5099ac24 | 164 | //-------------------------------------------------------------- |
c295e0f8 | 165 | //-------------------------- |
5099ac24 | 166 | //-------------------------------------------------------------- |
c295e0f8 | 167 | //-------------------------- |
c30ab7b3 | 168 | fn method(a: u32); |
c295e0f8 XL |
169 | |
170 | //------------------------------------------------------------------ | |
171 | //-------------------------- | |
172 | //------------------------------------------------------------------ | |
173 | //-------------------------- | |
32a655c1 | 174 | fn with_default(x: i32) {} |
c30ab7b3 SL |
175 | } |
176 | ||
c295e0f8 | 177 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
178 | #[rustc_clean(cfg="cfail2")] |
179 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
180 | #[rustc_clean(cfg="cfail5")] |
181 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 182 | trait TraitChangeMethodParameterName { |
32a655c1 | 183 | // FIXME(#38501) This should preferably always be clean. |
5099ac24 | 184 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 185 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 186 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 187 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 188 | fn method(b: u32); |
32a655c1 | 189 | |
17df50a5 XL |
190 | #[rustc_clean(except="hir_owner_nodes,optimized_mir", cfg="cfail2")] |
191 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
192 | #[rustc_clean(except="hir_owner_nodes,optimized_mir", cfg="cfail5")] |
193 | #[rustc_clean(cfg="cfail6")] | |
32a655c1 | 194 | fn with_default(y: i32) {} |
c30ab7b3 SL |
195 | } |
196 | ||
197 | ||
198 | ||
e1599b0c | 199 | // Change type of method parameter (i32 => i64) |
c295e0f8 | 200 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 201 | trait TraitChangeMethodParameterType { |
5099ac24 | 202 | // -------------------------------------------------------------------- |
c295e0f8 | 203 | // ------------------------- |
5099ac24 | 204 | // -------------------------------------------------------------------- |
c295e0f8 | 205 | // ------------------------- |
c30ab7b3 SL |
206 | fn method(a: i32); |
207 | } | |
208 | ||
c295e0f8 | 209 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
210 | #[rustc_clean(cfg="cfail2")] |
211 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
212 | #[rustc_clean(cfg="cfail5")] |
213 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 214 | trait TraitChangeMethodParameterType { |
5099ac24 | 215 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 216 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 217 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 218 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
219 | fn method(a: i64); |
220 | } | |
221 | ||
222 | ||
223 | ||
e1599b0c | 224 | // Change type of method parameter (&i32 => &mut i32) |
c295e0f8 | 225 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 226 | trait TraitChangeMethodParameterTypeRef { |
5099ac24 | 227 | // -------------------------------------------------------------------- |
c295e0f8 | 228 | // ------------------------- |
5099ac24 | 229 | // -------------------------------------------------------------------- |
c295e0f8 XL |
230 | // ------------------------- |
231 | fn method(a: & i32); | |
c30ab7b3 SL |
232 | } |
233 | ||
c295e0f8 | 234 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
235 | #[rustc_clean(cfg="cfail2")] |
236 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
237 | #[rustc_clean(cfg="cfail5")] |
238 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 239 | trait TraitChangeMethodParameterTypeRef { |
5099ac24 | 240 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 241 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 242 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 243 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
244 | fn method(a: &mut i32); |
245 | } | |
246 | ||
247 | ||
248 | ||
e1599b0c | 249 | // Change order of method parameters |
c295e0f8 | 250 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 251 | trait TraitChangeMethodParametersOrder { |
5099ac24 | 252 | // -------------------------------------------------------------------- |
c295e0f8 | 253 | // ------------------------- |
5099ac24 | 254 | // -------------------------------------------------------------------- |
c295e0f8 | 255 | // ------------------------- |
c30ab7b3 SL |
256 | fn method(a: i32, b: i64); |
257 | } | |
258 | ||
c295e0f8 | 259 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
260 | #[rustc_clean(cfg="cfail2")] |
261 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
262 | #[rustc_clean(cfg="cfail5")] |
263 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 264 | trait TraitChangeMethodParametersOrder { |
5099ac24 | 265 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 266 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 267 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 268 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
269 | fn method(b: i64, a: i32); |
270 | } | |
271 | ||
272 | ||
273 | ||
e1599b0c | 274 | // Add default implementation to method |
c295e0f8 | 275 | #[cfg(any(cfail1,cfail4))] |
abe05a73 | 276 | trait TraitAddMethodAutoImplementation { |
064997fb | 277 | // ------------------------------------------------------------- |
5099ac24 | 278 | // ------------------------- |
064997fb | 279 | // ------------------------------------------------------------- |
5099ac24 FG |
280 | // ------------------------- |
281 | fn method() ; | |
c30ab7b3 SL |
282 | } |
283 | ||
c295e0f8 | 284 | #[cfg(not(any(cfail1,cfail4)))] |
064997fb | 285 | #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 286 | #[rustc_clean(cfg="cfail3")] |
064997fb | 287 | #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 288 | #[rustc_clean(cfg="cfail6")] |
abe05a73 | 289 | trait TraitAddMethodAutoImplementation { |
064997fb | 290 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 291 | #[rustc_clean(cfg="cfail3")] |
064997fb | 292 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 293 | #[rustc_clean(cfg="cfail6")] |
5099ac24 | 294 | fn method() {} |
c30ab7b3 SL |
295 | } |
296 | ||
297 | ||
298 | ||
e1599b0c | 299 | // Change order of methods |
c295e0f8 | 300 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
301 | trait TraitChangeOrderOfMethods { |
302 | fn method0(); | |
303 | fn method1(); | |
304 | } | |
305 | ||
c295e0f8 | 306 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 307 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 308 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 309 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 310 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
311 | trait TraitChangeOrderOfMethods { |
312 | fn method1(); | |
313 | fn method0(); | |
314 | } | |
315 | ||
316 | ||
317 | ||
e1599b0c | 318 | // Change mode of self parameter |
c295e0f8 | 319 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 320 | trait TraitChangeModeSelfRefToMut { |
5099ac24 | 321 | // -------------------------------------------------------------------- |
c295e0f8 | 322 | // ------------------------- |
5099ac24 | 323 | // -------------------------------------------------------------------- |
c295e0f8 XL |
324 | // ------------------------- |
325 | fn method(& self); | |
c30ab7b3 SL |
326 | } |
327 | ||
c295e0f8 | 328 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
329 | #[rustc_clean(cfg="cfail2")] |
330 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
331 | #[rustc_clean(cfg="cfail5")] |
332 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 333 | trait TraitChangeModeSelfRefToMut { |
5099ac24 | 334 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 335 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 336 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 337 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
338 | fn method(&mut self); |
339 | } | |
340 | ||
341 | ||
342 | ||
c295e0f8 | 343 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 344 | trait TraitChangeModeSelfOwnToMut: Sized { |
c295e0f8 XL |
345 | // ---------------------------------------------------------------------------------- |
346 | // ------------------------- | |
347 | // ---------------------------------------------------------------------------------- | |
348 | // ------------------------- | |
349 | fn method( self) {} | |
c30ab7b3 SL |
350 | } |
351 | ||
c295e0f8 | 352 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
353 | #[rustc_clean(cfg="cfail2")] |
354 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
355 | #[rustc_clean(cfg="cfail5")] |
356 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 357 | trait TraitChangeModeSelfOwnToMut: Sized { |
17df50a5 XL |
358 | #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")] |
359 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
360 | #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck,optimized_mir", cfg="cfail5")] |
361 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
362 | fn method(mut self) {} |
363 | } | |
364 | ||
365 | ||
366 | ||
c295e0f8 | 367 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 368 | trait TraitChangeModeSelfOwnToRef { |
5099ac24 | 369 | // -------------------------------------------------------------------------------- |
c295e0f8 | 370 | // ------------------------- |
5099ac24 | 371 | // -------------------------------------------------------------------------------- |
c295e0f8 XL |
372 | // ------------------------- |
373 | fn method( self); | |
c30ab7b3 SL |
374 | } |
375 | ||
c295e0f8 | 376 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
377 | #[rustc_clean(cfg="cfail2")] |
378 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
379 | #[rustc_clean(cfg="cfail5")] |
380 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 381 | trait TraitChangeModeSelfOwnToRef { |
5099ac24 | 382 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail2")] |
17df50a5 | 383 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 384 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail5")] |
c295e0f8 | 385 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
386 | fn method(&self); |
387 | } | |
388 | ||
389 | ||
390 | ||
e1599b0c | 391 | // Add unsafe modifier to method |
c295e0f8 | 392 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 393 | trait TraitAddUnsafeModifier { |
5099ac24 | 394 | // -------------------------------------------------------------------- |
c295e0f8 | 395 | // ------------------------- |
5099ac24 | 396 | // -------------------------------------------------------------------- |
c295e0f8 XL |
397 | // ------------------------- |
398 | fn method() ; | |
c30ab7b3 SL |
399 | } |
400 | ||
c295e0f8 | 401 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
402 | #[rustc_clean(cfg="cfail2")] |
403 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 | 404 | #[rustc_clean(except="hir_owner", cfg="cfail5")] |
c295e0f8 | 405 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 406 | trait TraitAddUnsafeModifier { |
5099ac24 | 407 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 408 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 409 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 410 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
411 | unsafe fn method(); |
412 | } | |
413 | ||
414 | ||
415 | ||
e1599b0c | 416 | // Add extern modifier to method |
c295e0f8 | 417 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 418 | trait TraitAddExternModifier { |
5099ac24 | 419 | // -------------------------------------------------------------------- |
c295e0f8 | 420 | // ------------------------- |
5099ac24 | 421 | // -------------------------------------------------------------------- |
c295e0f8 XL |
422 | // ------------------------- |
423 | fn method() ; | |
c30ab7b3 SL |
424 | } |
425 | ||
c295e0f8 | 426 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
427 | #[rustc_clean(cfg="cfail2")] |
428 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 | 429 | #[rustc_clean(except="hir_owner", cfg="cfail5")] |
c295e0f8 | 430 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 431 | trait TraitAddExternModifier { |
5099ac24 | 432 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 433 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 434 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 435 | #[rustc_clean(cfg="cfail6")] |
5869c6ff | 436 | extern "C" fn method(); |
c30ab7b3 SL |
437 | } |
438 | ||
439 | ||
440 | ||
e1599b0c | 441 | // Change extern "C" to extern "stdcall" |
c295e0f8 | 442 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 443 | trait TraitChangeExternCToRustIntrinsic { |
5099ac24 | 444 | // -------------------------------------------------------------------- |
c295e0f8 | 445 | // ------------------------- |
5099ac24 | 446 | // -------------------------------------------------------------------- |
c295e0f8 XL |
447 | // ------------------------- |
448 | extern "C" fn method(); | |
c30ab7b3 SL |
449 | } |
450 | ||
c295e0f8 | 451 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
452 | #[rustc_clean(cfg="cfail2")] |
453 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
454 | #[rustc_clean(cfg="cfail5")] |
455 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 456 | trait TraitChangeExternCToRustIntrinsic { |
5099ac24 | 457 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 458 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 459 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
c295e0f8 | 460 | #[rustc_clean(cfg="cfail6")] |
e1599b0c | 461 | extern "stdcall" fn method(); |
c30ab7b3 SL |
462 | } |
463 | ||
464 | ||
465 | ||
e1599b0c | 466 | // Add type parameter to method |
c295e0f8 | 467 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 468 | trait TraitAddTypeParameterToMethod { |
5099ac24 FG |
469 | // -------------------------------------------------------------------------------- |
470 | // --------------- | |
c295e0f8 | 471 | // ------------------------- |
5099ac24 FG |
472 | // -------------------------------------------------------------------------------- |
473 | // --------------- | |
c295e0f8 XL |
474 | // ------------------------- |
475 | fn method (); | |
c30ab7b3 SL |
476 | } |
477 | ||
c295e0f8 | 478 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
479 | #[rustc_clean(cfg="cfail2")] |
480 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
481 | #[rustc_clean(cfg="cfail5")] |
482 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 483 | trait TraitAddTypeParameterToMethod { |
5099ac24 FG |
484 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of", |
485 | cfg="cfail2")] | |
17df50a5 | 486 | #[rustc_clean(cfg="cfail3")] |
5099ac24 FG |
487 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of,type_of", |
488 | cfg="cfail5")] | |
c295e0f8 | 489 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
490 | fn method<T>(); |
491 | } | |
492 | ||
493 | ||
494 | ||
e1599b0c | 495 | // Add lifetime parameter to method |
c295e0f8 | 496 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 497 | trait TraitAddLifetimeParameterToMethod { |
5099ac24 | 498 | // -------------------------------------------------------------------------------- |
c295e0f8 | 499 | // ------------------------- |
5099ac24 | 500 | // -------------------------------------------------------------------------------- |
c295e0f8 XL |
501 | // ------------------------- |
502 | fn method (); | |
c30ab7b3 SL |
503 | } |
504 | ||
c295e0f8 | 505 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
506 | #[rustc_clean(cfg="cfail2")] |
507 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
508 | #[rustc_clean(cfg="cfail5")] |
509 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 510 | trait TraitAddLifetimeParameterToMethod { |
5099ac24 | 511 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail2")] |
17df50a5 | 512 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 513 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig,generics_of", cfg="cfail5")] |
c295e0f8 | 514 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
515 | fn method<'a>(); |
516 | } | |
517 | ||
518 | ||
519 | ||
520 | // dummy trait for bound | |
521 | trait ReferencedTrait0 { } | |
522 | trait ReferencedTrait1 { } | |
523 | ||
e1599b0c | 524 | // Add trait bound to method type parameter |
c295e0f8 | 525 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 526 | trait TraitAddTraitBoundToMethodTypeParameter { |
c295e0f8 XL |
527 | // --------------------------------------------------------------------------- |
528 | // ------------------------- | |
529 | // --------------------------------------------------------------------------- | |
530 | // ------------------------- | |
531 | fn method<T >(); | |
c30ab7b3 SL |
532 | } |
533 | ||
c295e0f8 | 534 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
535 | #[rustc_clean(cfg="cfail2")] |
536 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
537 | #[rustc_clean(cfg="cfail5")] |
538 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 539 | trait TraitAddTraitBoundToMethodTypeParameter { |
17df50a5 XL |
540 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
541 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
542 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
543 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
544 | fn method<T: ReferencedTrait0>(); |
545 | } | |
546 | ||
547 | ||
548 | ||
e1599b0c | 549 | // Add builtin bound to method type parameter |
c295e0f8 | 550 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 551 | trait TraitAddBuiltinBoundToMethodTypeParameter { |
c295e0f8 XL |
552 | // --------------------------------------------------------------------------- |
553 | // ------------------------- | |
554 | // --------------------------------------------------------------------------- | |
555 | // ------------------------- | |
556 | fn method<T >(); | |
c30ab7b3 SL |
557 | } |
558 | ||
c295e0f8 | 559 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
560 | #[rustc_clean(cfg="cfail2")] |
561 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
562 | #[rustc_clean(cfg="cfail5")] |
563 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 564 | trait TraitAddBuiltinBoundToMethodTypeParameter { |
17df50a5 XL |
565 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
566 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
567 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
568 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
569 | fn method<T: Sized>(); |
570 | } | |
571 | ||
572 | ||
573 | ||
e1599b0c | 574 | // Add lifetime bound to method lifetime parameter |
c295e0f8 | 575 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 576 | trait TraitAddLifetimeBoundToMethodLifetimeParameter { |
c295e0f8 XL |
577 | // ----------- |
578 | // ----------------------------------------------------------------------------- | |
579 | // -------------- | |
580 | // | |
581 | // ------------------------- | |
582 | // ----------- | |
583 | // ----------------------------------------------------------------------------- | |
584 | // -------------- | |
585 | // | |
586 | // ------------------------- | |
587 | fn method<'a, 'b >(a: &'a u32, b: &'b u32); | |
588 | } | |
589 | ||
590 | #[cfg(not(any(cfail1,cfail4)))] | |
17df50a5 XL |
591 | #[rustc_clean(cfg="cfail2")] |
592 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
593 | #[rustc_clean(cfg="cfail5")] |
594 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 595 | trait TraitAddLifetimeBoundToMethodLifetimeParameter { |
17df50a5 XL |
596 | #[rustc_clean( |
597 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
598 | cfg="cfail2", | |
599 | )] | |
600 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
601 | #[rustc_clean( |
602 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
603 | cfg="cfail5", | |
604 | )] | |
605 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
606 | fn method<'a, 'b: 'a>(a: &'a u32, b: &'b u32); |
607 | } | |
608 | ||
609 | ||
610 | ||
e1599b0c | 611 | // Add second trait bound to method type parameter |
c295e0f8 | 612 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 613 | trait TraitAddSecondTraitBoundToMethodTypeParameter { |
c295e0f8 XL |
614 | // --------------------------------------------------------------------------- |
615 | // ------------------------- | |
616 | // --------------------------------------------------------------------------- | |
617 | // ------------------------- | |
618 | fn method<T: ReferencedTrait0 >(); | |
c30ab7b3 SL |
619 | } |
620 | ||
c295e0f8 | 621 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
622 | #[rustc_clean(cfg="cfail2")] |
623 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
624 | #[rustc_clean(cfg="cfail5")] |
625 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 626 | trait TraitAddSecondTraitBoundToMethodTypeParameter { |
17df50a5 XL |
627 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
628 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
629 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
630 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
631 | fn method<T: ReferencedTrait0 + ReferencedTrait1>(); |
632 | } | |
633 | ||
634 | ||
635 | ||
e1599b0c | 636 | // Add second builtin bound to method type parameter |
c295e0f8 | 637 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 638 | trait TraitAddSecondBuiltinBoundToMethodTypeParameter { |
c295e0f8 XL |
639 | // --------------------------------------------------------------------------- |
640 | // ------------------------- | |
641 | // --------------------------------------------------------------------------- | |
642 | // ------------------------- | |
643 | fn method<T: Sized >(); | |
c30ab7b3 SL |
644 | } |
645 | ||
c295e0f8 | 646 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
647 | #[rustc_clean(cfg="cfail2")] |
648 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
649 | #[rustc_clean(cfg="cfail5")] |
650 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 651 | trait TraitAddSecondBuiltinBoundToMethodTypeParameter { |
17df50a5 XL |
652 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
653 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
654 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
655 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
656 | fn method<T: Sized + Sync>(); |
657 | } | |
658 | ||
659 | ||
660 | ||
e1599b0c | 661 | // Add second lifetime bound to method lifetime parameter |
c295e0f8 | 662 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 663 | trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter { |
c295e0f8 XL |
664 | // ----------- |
665 | // ----------------------------------------------------------------------------- | |
666 | // -------------- | |
667 | // | |
668 | // ------------------------- | |
669 | // ----------- | |
670 | // ----------------------------------------------------------------------------- | |
671 | // -------------- | |
672 | // | |
673 | // ------------------------- | |
674 | fn method<'a, 'b, 'c: 'a >(a: &'a u32, b: &'b u32, c: &'c u32); | |
675 | } | |
676 | ||
677 | #[cfg(not(any(cfail1,cfail4)))] | |
17df50a5 XL |
678 | #[rustc_clean(cfg="cfail2")] |
679 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
680 | #[rustc_clean(cfg="cfail5")] |
681 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 682 | trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter { |
17df50a5 XL |
683 | #[rustc_clean( |
684 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
685 | cfg="cfail2", | |
686 | )] | |
687 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
688 | #[rustc_clean( |
689 | except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of", | |
690 | cfg="cfail5", | |
691 | )] | |
692 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
693 | fn method<'a, 'b, 'c: 'a + 'b>(a: &'a u32, b: &'b u32, c: &'c u32); |
694 | } | |
695 | ||
696 | ||
697 | ||
e1599b0c | 698 | // Add associated type |
c295e0f8 | 699 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 700 | trait TraitAddAssociatedType { |
c295e0f8 XL |
701 | //-------------------------- |
702 | //-------------------------- | |
703 | // ------------- | |
704 | ||
705 | //-------------------------- | |
706 | //-------------------------- | |
707 | //-------------------------- | |
708 | //-------------------------- | |
cc61c64b | 709 | fn method(); |
c30ab7b3 SL |
710 | } |
711 | ||
c295e0f8 | 712 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 713 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 714 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 715 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 716 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 717 | trait TraitAddAssociatedType { |
c295e0f8 XL |
718 | #[rustc_clean(cfg="cfail3")] |
719 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
720 | type Associated; |
721 | ||
c295e0f8 XL |
722 | #[rustc_clean(cfg="cfail2")] |
723 | #[rustc_clean(cfg="cfail3")] | |
724 | #[rustc_clean(cfg="cfail5")] | |
725 | #[rustc_clean(cfg="cfail6")] | |
cc61c64b | 726 | fn method(); |
c30ab7b3 SL |
727 | } |
728 | ||
729 | ||
730 | ||
e1599b0c | 731 | // Add trait bound to associated type |
c295e0f8 | 732 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 733 | trait TraitAddTraitBoundToAssociatedType { |
5099ac24 | 734 | // ------------------------------------------------------------- |
c295e0f8 | 735 | // ------------------------- |
5099ac24 | 736 | // ------------------------------------------------------------- |
c295e0f8 XL |
737 | // ------------------------- |
738 | type Associated ; | |
c30ab7b3 | 739 | |
cc61c64b | 740 | fn method(); |
c30ab7b3 SL |
741 | } |
742 | ||
cc61c64b XL |
743 | |
744 | // Apparently the type bound contributes to the predicates of the trait, but | |
745 | // does not change the associated item itself. | |
c295e0f8 | 746 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
747 | #[rustc_clean(cfg="cfail2")] |
748 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
749 | #[rustc_clean(cfg="cfail5")] |
750 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 751 | trait TraitAddTraitBoundToAssociatedType { |
5099ac24 | 752 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 753 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 754 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 755 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
756 | type Associated: ReferencedTrait0; |
757 | ||
cc61c64b | 758 | fn method(); |
c30ab7b3 SL |
759 | } |
760 | ||
761 | ||
762 | ||
e1599b0c | 763 | // Add lifetime bound to associated type |
c295e0f8 | 764 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 765 | trait TraitAddLifetimeBoundToAssociatedType<'a> { |
5099ac24 | 766 | // ------------------------------------------------------------- |
c295e0f8 | 767 | // ------------------------- |
5099ac24 | 768 | // ------------------------------------------------------------- |
c295e0f8 XL |
769 | // ------------------------- |
770 | type Associated ; | |
c30ab7b3 | 771 | |
cc61c64b | 772 | fn method(); |
c30ab7b3 SL |
773 | } |
774 | ||
c295e0f8 | 775 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
776 | #[rustc_clean(cfg="cfail2")] |
777 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
778 | #[rustc_clean(cfg="cfail5")] |
779 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 780 | trait TraitAddLifetimeBoundToAssociatedType<'a> { |
5099ac24 | 781 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 782 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 783 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 784 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
785 | type Associated: 'a; |
786 | ||
cc61c64b | 787 | fn method(); |
c30ab7b3 SL |
788 | } |
789 | ||
790 | ||
791 | ||
e1599b0c | 792 | // Add default to associated type |
c295e0f8 | 793 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 794 | trait TraitAddDefaultToAssociatedType { |
064997fb FG |
795 | //-------------------------------------------------------------- |
796 | //-------------------------- | |
797 | //-------------------------------------------------------------- | |
798 | //-------------------------- | |
799 | type Associated ; | |
c30ab7b3 | 800 | |
cc61c64b | 801 | fn method(); |
c30ab7b3 SL |
802 | } |
803 | ||
c295e0f8 | 804 | #[cfg(not(any(cfail1,cfail4)))] |
064997fb | 805 | #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 806 | #[rustc_clean(cfg="cfail3")] |
064997fb | 807 | #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 808 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 809 | trait TraitAddDefaultToAssociatedType { |
064997fb | 810 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 811 | #[rustc_clean(cfg="cfail3")] |
064997fb | 812 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 813 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
814 | type Associated = ReferenceType0; |
815 | ||
cc61c64b | 816 | fn method(); |
c30ab7b3 SL |
817 | } |
818 | ||
819 | ||
820 | ||
e1599b0c | 821 | // Add associated constant |
c295e0f8 | 822 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 823 | trait TraitAddAssociatedConstant { |
cc61c64b | 824 | fn method(); |
c30ab7b3 SL |
825 | } |
826 | ||
c295e0f8 | 827 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 828 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")] |
17df50a5 | 829 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 830 | #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")] |
c295e0f8 | 831 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
832 | trait TraitAddAssociatedConstant { |
833 | const Value: u32; | |
834 | ||
cc61c64b | 835 | fn method(); |
c30ab7b3 SL |
836 | } |
837 | ||
838 | ||
839 | ||
e1599b0c | 840 | // Add initializer to associated constant |
c295e0f8 | 841 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 842 | trait TraitAddInitializerToAssociatedConstant { |
064997fb FG |
843 | //-------------------------------------------------------------- |
844 | //-------------------------- | |
845 | //-------------------------------------------------------------- | |
846 | //-------------------------- | |
847 | const Value: u32 ; | |
c30ab7b3 | 848 | |
064997fb FG |
849 | //-------------------------- |
850 | //-------------------------- | |
851 | //-------------------------- | |
852 | //-------------------------- | |
cc61c64b | 853 | fn method(); |
c30ab7b3 SL |
854 | } |
855 | ||
c295e0f8 | 856 | #[cfg(not(any(cfail1,cfail4)))] |
064997fb | 857 | #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 858 | #[rustc_clean(cfg="cfail3")] |
064997fb | 859 | #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 860 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 | 861 | trait TraitAddInitializerToAssociatedConstant { |
064997fb | 862 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")] |
17df50a5 | 863 | #[rustc_clean(cfg="cfail3")] |
064997fb | 864 | #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")] |
c295e0f8 | 865 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
866 | const Value: u32 = 1; |
867 | ||
17df50a5 XL |
868 | #[rustc_clean(cfg="cfail2")] |
869 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
870 | #[rustc_clean(cfg="cfail5")] |
871 | #[rustc_clean(cfg="cfail6")] | |
cc61c64b | 872 | fn method(); |
c30ab7b3 SL |
873 | } |
874 | ||
875 | ||
876 | ||
e1599b0c | 877 | // Change type of associated constant |
c295e0f8 | 878 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 879 | trait TraitChangeTypeOfAssociatedConstant { |
5099ac24 | 880 | // --------------------------------------------------------------------- |
c295e0f8 | 881 | // ------------------------- |
5099ac24 | 882 | // --------------------------------------------------------------------- |
c295e0f8 | 883 | // ------------------------- |
c30ab7b3 SL |
884 | const Value: u32; |
885 | ||
c295e0f8 XL |
886 | // ------------------------- |
887 | // ------------------------- | |
888 | // ------------------------- | |
889 | // ------------------------- | |
cc61c64b | 890 | fn method(); |
c30ab7b3 SL |
891 | } |
892 | ||
c295e0f8 | 893 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
894 | #[rustc_clean(cfg="cfail2")] |
895 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
896 | #[rustc_clean(cfg="cfail5")] |
897 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 898 | trait TraitChangeTypeOfAssociatedConstant { |
5099ac24 | 899 | #[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail2")] |
17df50a5 | 900 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 901 | #[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail5")] |
c295e0f8 | 902 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
903 | const Value: f64; |
904 | ||
17df50a5 XL |
905 | #[rustc_clean(cfg="cfail2")] |
906 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
907 | #[rustc_clean(cfg="cfail5")] |
908 | #[rustc_clean(cfg="cfail6")] | |
cc61c64b | 909 | fn method(); |
c30ab7b3 SL |
910 | } |
911 | ||
912 | ||
913 | ||
e1599b0c | 914 | // Add super trait |
c295e0f8 | 915 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
916 | trait TraitAddSuperTrait { } |
917 | ||
c295e0f8 | 918 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 919 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 920 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 921 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 922 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
923 | trait TraitAddSuperTrait : ReferencedTrait0 { } |
924 | ||
925 | ||
926 | ||
e1599b0c | 927 | // Add builtin bound (Send or Copy) |
c295e0f8 | 928 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
929 | trait TraitAddBuiltiBound { } |
930 | ||
c295e0f8 | 931 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 932 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 933 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 934 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 935 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
936 | trait TraitAddBuiltiBound : Send { } |
937 | ||
938 | ||
939 | ||
e1599b0c | 940 | // Add 'static lifetime bound to trait |
c295e0f8 | 941 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
942 | trait TraitAddStaticLifetimeBound { } |
943 | ||
c295e0f8 | 944 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 945 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 946 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 947 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 948 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
949 | trait TraitAddStaticLifetimeBound : 'static { } |
950 | ||
951 | ||
952 | ||
e1599b0c | 953 | // Add super trait as second bound |
c295e0f8 | 954 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
955 | trait TraitAddTraitAsSecondBound : ReferencedTrait0 { } |
956 | ||
c295e0f8 | 957 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 958 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 959 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 960 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 961 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
962 | trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { } |
963 | ||
c295e0f8 | 964 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
965 | trait TraitAddTraitAsSecondBoundFromBuiltin : Send { } |
966 | ||
c295e0f8 | 967 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 968 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 969 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 970 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 971 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
972 | trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { } |
973 | ||
974 | ||
975 | ||
e1599b0c | 976 | // Add builtin bound as second bound |
c295e0f8 | 977 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
978 | trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { } |
979 | ||
c295e0f8 | 980 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 981 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 982 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 983 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 984 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
985 | trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { } |
986 | ||
c295e0f8 | 987 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
988 | trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { } |
989 | ||
c295e0f8 | 990 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 991 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 992 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 993 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 994 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
995 | trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { } |
996 | ||
997 | ||
998 | ||
e1599b0c | 999 | // Add 'static bounds as second bound |
c295e0f8 | 1000 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1001 | trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { } |
1002 | ||
c295e0f8 | 1003 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 1004 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 1005 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 1006 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 1007 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1008 | trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { } |
1009 | ||
c295e0f8 | 1010 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1011 | trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { } |
1012 | ||
c295e0f8 | 1013 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 1014 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 1015 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 1016 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 1017 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1018 | trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { } |
1019 | ||
1020 | ||
1021 | ||
e1599b0c | 1022 | // Add type parameter to trait |
c295e0f8 | 1023 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1024 | trait TraitAddTypeParameterToTrait { } |
1025 | ||
c295e0f8 | 1026 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 1027 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
17df50a5 | 1028 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 1029 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
c295e0f8 | 1030 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1031 | trait TraitAddTypeParameterToTrait<T> { } |
1032 | ||
1033 | ||
1034 | ||
e1599b0c | 1035 | // Add lifetime parameter to trait |
c295e0f8 | 1036 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1037 | trait TraitAddLifetimeParameterToTrait { } |
1038 | ||
c295e0f8 | 1039 | #[cfg(not(any(cfail1,cfail4)))] |
5099ac24 | 1040 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
17df50a5 | 1041 | #[rustc_clean(cfg="cfail3")] |
5099ac24 | 1042 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
c295e0f8 | 1043 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1044 | trait TraitAddLifetimeParameterToTrait<'a> { } |
1045 | ||
1046 | ||
1047 | ||
e1599b0c | 1048 | // Add trait bound to type parameter of trait |
c295e0f8 | 1049 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1050 | trait TraitAddTraitBoundToTypeParameterOfTrait<T> { } |
1051 | ||
c295e0f8 | 1052 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1053 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1054 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1055 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1056 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1057 | trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { } |
1058 | ||
1059 | ||
1060 | ||
e1599b0c | 1061 | // Add lifetime bound to type parameter of trait |
c295e0f8 | 1062 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1063 | trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { } |
1064 | ||
c295e0f8 | 1065 | #[cfg(not(any(cfail1,cfail4)))] |
f2b60f7d | 1066 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 1067 | #[rustc_clean(cfg="cfail3")] |
f2b60f7d | 1068 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 1069 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1070 | trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { } |
1071 | ||
1072 | ||
1073 | ||
e1599b0c | 1074 | // Add lifetime bound to lifetime parameter of trait |
c295e0f8 | 1075 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1076 | trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { } |
1077 | ||
c295e0f8 | 1078 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1079 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1080 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1081 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1082 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1083 | trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { } |
1084 | ||
1085 | ||
1086 | ||
e1599b0c | 1087 | // Add builtin bound to type parameter of trait |
c295e0f8 | 1088 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1089 | trait TraitAddBuiltinBoundToTypeParameterOfTrait<T> { } |
1090 | ||
c295e0f8 | 1091 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1092 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1093 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1094 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1095 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1096 | trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { } |
1097 | ||
1098 | ||
1099 | ||
e1599b0c | 1100 | // Add second type parameter to trait |
c295e0f8 | 1101 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1102 | trait TraitAddSecondTypeParameterToTrait<T> { } |
1103 | ||
c295e0f8 | 1104 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1105 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1106 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1107 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1108 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1109 | trait TraitAddSecondTypeParameterToTrait<T, S> { } |
1110 | ||
1111 | ||
1112 | ||
e1599b0c | 1113 | // Add second lifetime parameter to trait |
c295e0f8 | 1114 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1115 | trait TraitAddSecondLifetimeParameterToTrait<'a> { } |
1116 | ||
c295e0f8 | 1117 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1118 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")] |
1119 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1120 | #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")] |
1121 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1122 | trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { } |
1123 | ||
1124 | ||
1125 | ||
e1599b0c | 1126 | // Add second trait bound to type parameter of trait |
c295e0f8 | 1127 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1128 | trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { } |
1129 | ||
c295e0f8 | 1130 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1131 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1132 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1133 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1134 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1135 | trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + ReferencedTrait1> { } |
1136 | ||
1137 | ||
1138 | ||
e1599b0c | 1139 | // Add second lifetime bound to type parameter of trait |
c295e0f8 | 1140 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1141 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { } |
1142 | ||
c295e0f8 | 1143 | #[cfg(not(any(cfail1,cfail4)))] |
f2b60f7d | 1144 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 1145 | #[rustc_clean(cfg="cfail3")] |
f2b60f7d | 1146 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 1147 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1148 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { } |
1149 | ||
1150 | ||
1151 | ||
e1599b0c | 1152 | // Add second lifetime bound to lifetime parameter of trait |
c295e0f8 | 1153 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1154 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { } |
1155 | ||
c295e0f8 | 1156 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1157 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1158 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1159 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1160 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1161 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { } |
1162 | ||
1163 | ||
1164 | ||
e1599b0c | 1165 | // Add second builtin bound to type parameter of trait |
c295e0f8 | 1166 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1167 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send> { } |
1168 | ||
c295e0f8 | 1169 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1170 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1171 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1172 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1173 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1174 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send + Sync> { } |
1175 | ||
1176 | ||
1177 | ||
c30ab7b3 SL |
1178 | struct ReferenceType0 {} |
1179 | struct ReferenceType1 {} | |
1180 | ||
1181 | ||
1182 | ||
e1599b0c | 1183 | // Add trait bound to type parameter of trait in where clause |
c295e0f8 | 1184 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1185 | trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> { } |
1186 | ||
c295e0f8 | 1187 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1188 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1189 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1190 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1191 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1192 | trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { } |
1193 | ||
1194 | ||
1195 | ||
e1599b0c | 1196 | // Add lifetime bound to type parameter of trait in where clause |
c295e0f8 | 1197 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1198 | trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { } |
1199 | ||
c295e0f8 | 1200 | #[cfg(not(any(cfail1,cfail4)))] |
f2b60f7d | 1201 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 1202 | #[rustc_clean(cfg="cfail3")] |
f2b60f7d | 1203 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 1204 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1205 | trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { } |
1206 | ||
1207 | ||
1208 | ||
e1599b0c | 1209 | // Add lifetime bound to lifetime parameter of trait in where clause |
c295e0f8 | 1210 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1211 | trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { } |
1212 | ||
c295e0f8 | 1213 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1214 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1215 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1216 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1217 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1218 | trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { } |
1219 | ||
1220 | ||
1221 | ||
e1599b0c | 1222 | // Add builtin bound to type parameter of trait in where clause |
c295e0f8 | 1223 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1224 | trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> { } |
1225 | ||
c295e0f8 | 1226 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1227 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1228 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1229 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1230 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1231 | trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { } |
1232 | ||
1233 | ||
1234 | ||
e1599b0c | 1235 | // Add second trait bound to type parameter of trait in where clause |
c295e0f8 | 1236 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1237 | trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { } |
1238 | ||
c295e0f8 | 1239 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1240 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1241 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1242 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1243 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1244 | trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> |
1245 | where T: ReferencedTrait0 + ReferencedTrait1 { } | |
1246 | ||
1247 | ||
1248 | ||
e1599b0c | 1249 | // Add second lifetime bound to type parameter of trait in where clause |
c295e0f8 | 1250 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1251 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { } |
1252 | ||
c295e0f8 | 1253 | #[cfg(not(any(cfail1,cfail4)))] |
f2b60f7d | 1254 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
17df50a5 | 1255 | #[rustc_clean(cfg="cfail3")] |
f2b60f7d | 1256 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
c295e0f8 | 1257 | #[rustc_clean(cfg="cfail6")] |
c30ab7b3 SL |
1258 | trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { } |
1259 | ||
1260 | ||
1261 | ||
e1599b0c | 1262 | // Add second lifetime bound to lifetime parameter of trait in where clause |
c295e0f8 | 1263 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1264 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { } |
1265 | ||
c295e0f8 | 1266 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1267 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1268 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1269 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1270 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1271 | trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { } |
1272 | ||
1273 | ||
1274 | ||
e1599b0c | 1275 | // Add second builtin bound to type parameter of trait in where clause |
c295e0f8 | 1276 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 SL |
1277 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { } |
1278 | ||
c295e0f8 | 1279 | #[cfg(not(any(cfail1,cfail4)))] |
17df50a5 XL |
1280 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1281 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1282 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1283 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1284 | trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { } |
1285 | ||
1286 | ||
e1599b0c | 1287 | // Change return type of method indirectly by modifying a use statement |
c30ab7b3 | 1288 | mod change_return_type_of_method_indirectly_use { |
c295e0f8 | 1289 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1290 | use super::ReferenceType0 as ReturnType; |
c295e0f8 | 1291 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1292 | use super::ReferenceType1 as ReturnType; |
1293 | ||
17df50a5 XL |
1294 | #[rustc_clean(cfg="cfail2")] |
1295 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1296 | #[rustc_clean(cfg="cfail5")] |
1297 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1298 | trait TraitChangeReturnType { |
17df50a5 XL |
1299 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
1300 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1301 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
1302 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1303 | fn method() -> ReturnType; |
1304 | } | |
1305 | } | |
1306 | ||
1307 | ||
1308 | ||
e1599b0c | 1309 | // Change type of method parameter indirectly by modifying a use statement |
c30ab7b3 | 1310 | mod change_method_parameter_type_indirectly_by_use { |
c295e0f8 | 1311 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1312 | use super::ReferenceType0 as ArgType; |
c295e0f8 | 1313 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1314 | use super::ReferenceType1 as ArgType; |
1315 | ||
17df50a5 XL |
1316 | #[rustc_clean(cfg="cfail2")] |
1317 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1318 | #[rustc_clean(cfg="cfail5")] |
1319 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1320 | trait TraitChangeArgType { |
5099ac24 | 1321 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")] |
17df50a5 | 1322 | #[rustc_clean(cfg="cfail3")] |
5099ac24 FG |
1323 | #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")] |
1324 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1325 | fn method(a: ArgType); |
1326 | } | |
1327 | } | |
1328 | ||
1329 | ||
1330 | ||
1331 | // Change trait bound of method type parameter indirectly by modifying a use statement | |
1332 | mod change_method_parameter_type_bound_indirectly_by_use { | |
c295e0f8 | 1333 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1334 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1335 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1336 | use super::ReferencedTrait1 as Bound; |
1337 | ||
17df50a5 XL |
1338 | #[rustc_clean(cfg="cfail2")] |
1339 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1340 | #[rustc_clean(cfg="cfail5")] |
1341 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1342 | trait TraitChangeBoundOfMethodTypeParameter { |
17df50a5 XL |
1343 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1344 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1345 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1346 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1347 | fn method<T: Bound>(a: T); |
1348 | } | |
1349 | } | |
1350 | ||
1351 | ||
1352 | ||
1353 | // Change trait bound of method type parameter in where clause indirectly | |
1354 | // by modifying a use statement | |
1355 | mod change_method_parameter_type_bound_indirectly_by_use_where { | |
c295e0f8 | 1356 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1357 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1358 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1359 | use super::ReferencedTrait1 as Bound; |
1360 | ||
17df50a5 XL |
1361 | #[rustc_clean(cfg="cfail2")] |
1362 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1363 | #[rustc_clean(cfg="cfail5")] |
1364 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 | 1365 | trait TraitChangeBoundOfMethodTypeParameterWhere { |
17df50a5 XL |
1366 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1367 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1368 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1369 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1370 | fn method<T>(a: T) where T: Bound; |
1371 | } | |
1372 | } | |
1373 | ||
1374 | ||
1375 | ||
1376 | // Change trait bound of trait type parameter indirectly by modifying a use statement | |
1377 | mod change_method_type_parameter_bound_indirectly { | |
c295e0f8 | 1378 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1379 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1380 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1381 | use super::ReferencedTrait1 as Bound; |
1382 | ||
17df50a5 XL |
1383 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1384 | #[rustc_clean(cfg="cfail3")] | |
5099ac24 FG |
1385 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1386 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1387 | trait TraitChangeTraitBound<T: Bound> { |
1388 | fn method(a: T); | |
1389 | } | |
1390 | } | |
1391 | ||
1392 | ||
1393 | ||
1394 | // Change trait bound of trait type parameter in where clause indirectly | |
1395 | // by modifying a use statement | |
1396 | mod change_method_type_parameter_bound_indirectly_where { | |
c295e0f8 | 1397 | #[cfg(any(cfail1,cfail4))] |
c30ab7b3 | 1398 | use super::ReferencedTrait0 as Bound; |
c295e0f8 | 1399 | #[cfg(not(any(cfail1,cfail4)))] |
c30ab7b3 SL |
1400 | use super::ReferencedTrait1 as Bound; |
1401 | ||
17df50a5 XL |
1402 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")] |
1403 | #[rustc_clean(cfg="cfail3")] | |
c295e0f8 XL |
1404 | #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")] |
1405 | #[rustc_clean(cfg="cfail6")] | |
c30ab7b3 SL |
1406 | trait TraitChangeTraitBoundWhere<T> where T: Bound { |
1407 | fn method(a: T); | |
1408 | } | |
1409 | } |