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