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