]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/hashes/trait_defs.rs
Rollup merge of #99738 - notriddle:notriddle/multiple-modules-w-same-name, r=camelid
[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_nodes", cfg="cfail2")]
289 #[rustc_clean(cfg="cfail3")]
290 #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")]
291 #[rustc_clean(cfg="cfail6")]
292 trait TraitAddMethodAutoImplementation {
293     #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")]
294     #[rustc_clean(cfg="cfail3")]
295     #[rustc_clean(except="hir_owner,hir_owner_nodes", 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     //--------------------------------------------------------------
799     //--------------------------
800     //--------------------------------------------------------------
801     //--------------------------
802     type Associated                 ;
803
804     fn method();
805 }
806
807 #[cfg(not(any(cfail1,cfail4)))]
808 #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")]
809 #[rustc_clean(cfg="cfail3")]
810 #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")]
811 #[rustc_clean(cfg="cfail6")]
812 trait TraitAddDefaultToAssociatedType {
813     #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")]
814     #[rustc_clean(cfg="cfail3")]
815     #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")]
816     #[rustc_clean(cfg="cfail6")]
817     type Associated = ReferenceType0;
818
819     fn method();
820 }
821
822
823
824 // Add associated constant
825 #[cfg(any(cfail1,cfail4))]
826 trait TraitAddAssociatedConstant {
827     fn method();
828 }
829
830 #[cfg(not(any(cfail1,cfail4)))]
831 #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
832 #[rustc_clean(cfg="cfail3")]
833 #[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
834 #[rustc_clean(cfg="cfail6")]
835 trait TraitAddAssociatedConstant {
836     const Value: u32;
837
838     fn method();
839 }
840
841
842
843 // Add initializer to associated constant
844 #[cfg(any(cfail1,cfail4))]
845 trait TraitAddInitializerToAssociatedConstant {
846     //--------------------------------------------------------------
847     //--------------------------
848     //--------------------------------------------------------------
849     //--------------------------
850     const Value: u32    ;
851
852     //--------------------------
853     //--------------------------
854     //--------------------------
855     //--------------------------
856     fn method();
857 }
858
859 #[cfg(not(any(cfail1,cfail4)))]
860 #[rustc_clean(except="hir_owner_nodes", cfg="cfail2")]
861 #[rustc_clean(cfg="cfail3")]
862 #[rustc_clean(except="hir_owner_nodes", cfg="cfail5")]
863 #[rustc_clean(cfg="cfail6")]
864 trait TraitAddInitializerToAssociatedConstant {
865     #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail2")]
866     #[rustc_clean(cfg="cfail3")]
867     #[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")]
868     #[rustc_clean(cfg="cfail6")]
869     const Value: u32 = 1;
870
871     #[rustc_clean(cfg="cfail2")]
872     #[rustc_clean(cfg="cfail3")]
873     #[rustc_clean(cfg="cfail5")]
874     #[rustc_clean(cfg="cfail6")]
875     fn method();
876 }
877
878
879
880 // Change type of associated constant
881 #[cfg(any(cfail1,cfail4))]
882 trait TraitChangeTypeOfAssociatedConstant {
883     // ---------------------------------------------------------------------
884     // -------------------------
885     // ---------------------------------------------------------------------
886     // -------------------------
887     const Value: u32;
888
889     // -------------------------
890     // -------------------------
891     // -------------------------
892     // -------------------------
893     fn method();
894 }
895
896 #[cfg(not(any(cfail1,cfail4)))]
897 #[rustc_clean(cfg="cfail2")]
898 #[rustc_clean(cfg="cfail3")]
899 #[rustc_clean(cfg="cfail5")]
900 #[rustc_clean(cfg="cfail6")]
901 trait TraitChangeTypeOfAssociatedConstant {
902     #[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail2")]
903     #[rustc_clean(cfg="cfail3")]
904     #[rustc_clean(except="hir_owner,hir_owner_nodes,type_of", cfg="cfail5")]
905     #[rustc_clean(cfg="cfail6")]
906     const Value: f64;
907
908     #[rustc_clean(cfg="cfail2")]
909     #[rustc_clean(cfg="cfail3")]
910     #[rustc_clean(cfg="cfail5")]
911     #[rustc_clean(cfg="cfail6")]
912     fn method();
913 }
914
915
916
917 // Add super trait
918 #[cfg(any(cfail1,cfail4))]
919 trait TraitAddSuperTrait { }
920
921 #[cfg(not(any(cfail1,cfail4)))]
922 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
923 #[rustc_clean(cfg="cfail3")]
924 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
925 #[rustc_clean(cfg="cfail6")]
926 trait TraitAddSuperTrait : ReferencedTrait0 { }
927
928
929
930 // Add builtin bound (Send or Copy)
931 #[cfg(any(cfail1,cfail4))]
932 trait TraitAddBuiltiBound { }
933
934 #[cfg(not(any(cfail1,cfail4)))]
935 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
936 #[rustc_clean(cfg="cfail3")]
937 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
938 #[rustc_clean(cfg="cfail6")]
939 trait TraitAddBuiltiBound : Send { }
940
941
942
943 // Add 'static lifetime bound to trait
944 #[cfg(any(cfail1,cfail4))]
945 trait TraitAddStaticLifetimeBound { }
946
947 #[cfg(not(any(cfail1,cfail4)))]
948 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
949 #[rustc_clean(cfg="cfail3")]
950 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
951 #[rustc_clean(cfg="cfail6")]
952 trait TraitAddStaticLifetimeBound : 'static { }
953
954
955
956 // Add super trait as second bound
957 #[cfg(any(cfail1,cfail4))]
958 trait TraitAddTraitAsSecondBound : ReferencedTrait0 { }
959
960 #[cfg(not(any(cfail1,cfail4)))]
961 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
962 #[rustc_clean(cfg="cfail3")]
963 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
964 #[rustc_clean(cfg="cfail6")]
965 trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { }
966
967 #[cfg(any(cfail1,cfail4))]
968 trait TraitAddTraitAsSecondBoundFromBuiltin : Send { }
969
970 #[cfg(not(any(cfail1,cfail4)))]
971 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
972 #[rustc_clean(cfg="cfail3")]
973 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
974 #[rustc_clean(cfg="cfail6")]
975 trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { }
976
977
978
979 // Add builtin bound as second bound
980 #[cfg(any(cfail1,cfail4))]
981 trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { }
982
983 #[cfg(not(any(cfail1,cfail4)))]
984 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
985 #[rustc_clean(cfg="cfail3")]
986 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
987 #[rustc_clean(cfg="cfail6")]
988 trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { }
989
990 #[cfg(any(cfail1,cfail4))]
991 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { }
992
993 #[cfg(not(any(cfail1,cfail4)))]
994 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
995 #[rustc_clean(cfg="cfail3")]
996 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
997 #[rustc_clean(cfg="cfail6")]
998 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { }
999
1000
1001
1002 // Add 'static bounds as second bound
1003 #[cfg(any(cfail1,cfail4))]
1004 trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { }
1005
1006 #[cfg(not(any(cfail1,cfail4)))]
1007 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1008 #[rustc_clean(cfg="cfail3")]
1009 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1010 #[rustc_clean(cfg="cfail6")]
1011 trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { }
1012
1013 #[cfg(any(cfail1,cfail4))]
1014 trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { }
1015
1016 #[cfg(not(any(cfail1,cfail4)))]
1017 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1018 #[rustc_clean(cfg="cfail3")]
1019 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1020 #[rustc_clean(cfg="cfail6")]
1021 trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { }
1022
1023
1024
1025 // Add type parameter to trait
1026 #[cfg(any(cfail1,cfail4))]
1027 trait TraitAddTypeParameterToTrait { }
1028
1029 #[cfg(not(any(cfail1,cfail4)))]
1030 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1031 #[rustc_clean(cfg="cfail3")]
1032 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1033 #[rustc_clean(cfg="cfail6")]
1034 trait TraitAddTypeParameterToTrait<T> { }
1035
1036
1037
1038 // Add lifetime parameter to trait
1039 #[cfg(any(cfail1,cfail4))]
1040 trait TraitAddLifetimeParameterToTrait { }
1041
1042 #[cfg(not(any(cfail1,cfail4)))]
1043 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1044 #[rustc_clean(cfg="cfail3")]
1045 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1046 #[rustc_clean(cfg="cfail6")]
1047 trait TraitAddLifetimeParameterToTrait<'a> { }
1048
1049
1050
1051 // Add trait bound to type parameter of trait
1052 #[cfg(any(cfail1,cfail4))]
1053 trait TraitAddTraitBoundToTypeParameterOfTrait<T> { }
1054
1055 #[cfg(not(any(cfail1,cfail4)))]
1056 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1057 #[rustc_clean(cfg="cfail3")]
1058 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1059 #[rustc_clean(cfg="cfail6")]
1060 trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
1061
1062
1063
1064 // Add lifetime bound to type parameter of trait
1065 #[cfg(any(cfail1,cfail4))]
1066 trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { }
1067
1068 #[cfg(not(any(cfail1,cfail4)))]
1069 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1070 #[rustc_clean(cfg="cfail3")]
1071 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1072 #[rustc_clean(cfg="cfail6")]
1073 trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
1074
1075
1076
1077 // Add lifetime bound to lifetime parameter of trait
1078 #[cfg(any(cfail1,cfail4))]
1079 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { }
1080
1081 #[cfg(not(any(cfail1,cfail4)))]
1082 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1083 #[rustc_clean(cfg="cfail3")]
1084 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1085 #[rustc_clean(cfg="cfail6")]
1086 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { }
1087
1088
1089
1090 // Add builtin bound to type parameter of trait
1091 #[cfg(any(cfail1,cfail4))]
1092 trait TraitAddBuiltinBoundToTypeParameterOfTrait<T> { }
1093
1094 #[cfg(not(any(cfail1,cfail4)))]
1095 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1096 #[rustc_clean(cfg="cfail3")]
1097 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1098 #[rustc_clean(cfg="cfail6")]
1099 trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { }
1100
1101
1102
1103 // Add second type parameter to trait
1104 #[cfg(any(cfail1,cfail4))]
1105 trait TraitAddSecondTypeParameterToTrait<T> { }
1106
1107 #[cfg(not(any(cfail1,cfail4)))]
1108 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1109 #[rustc_clean(cfg="cfail3")]
1110 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1111 #[rustc_clean(cfg="cfail6")]
1112 trait TraitAddSecondTypeParameterToTrait<T, S> { }
1113
1114
1115
1116 // Add second lifetime parameter to trait
1117 #[cfg(any(cfail1,cfail4))]
1118 trait TraitAddSecondLifetimeParameterToTrait<'a> { }
1119
1120 #[cfg(not(any(cfail1,cfail4)))]
1121 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1122 #[rustc_clean(cfg="cfail3")]
1123 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1124 #[rustc_clean(cfg="cfail6")]
1125 trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { }
1126
1127
1128
1129 // Add second trait bound to type parameter of trait
1130 #[cfg(any(cfail1,cfail4))]
1131 trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
1132
1133 #[cfg(not(any(cfail1,cfail4)))]
1134 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1135 #[rustc_clean(cfg="cfail3")]
1136 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1137 #[rustc_clean(cfg="cfail6")]
1138 trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + ReferencedTrait1> { }
1139
1140
1141
1142 // Add second lifetime bound to type parameter of trait
1143 #[cfg(any(cfail1,cfail4))]
1144 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { }
1145
1146 #[cfg(not(any(cfail1,cfail4)))]
1147 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1148 #[rustc_clean(cfg="cfail3")]
1149 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1150 #[rustc_clean(cfg="cfail6")]
1151 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
1152
1153
1154
1155 // Add second lifetime bound to lifetime parameter of trait
1156 #[cfg(any(cfail1,cfail4))]
1157 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { }
1158
1159 #[cfg(not(any(cfail1,cfail4)))]
1160 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1161 #[rustc_clean(cfg="cfail3")]
1162 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1163 #[rustc_clean(cfg="cfail6")]
1164 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { }
1165
1166
1167
1168 // Add second builtin bound to type parameter of trait
1169 #[cfg(any(cfail1,cfail4))]
1170 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send> { }
1171
1172 #[cfg(not(any(cfail1,cfail4)))]
1173 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1174 #[rustc_clean(cfg="cfail3")]
1175 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1176 #[rustc_clean(cfg="cfail6")]
1177 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send + Sync> { }
1178
1179
1180
1181 struct ReferenceType0 {}
1182 struct ReferenceType1 {}
1183
1184
1185
1186 // Add trait bound to type parameter of trait in where clause
1187 #[cfg(any(cfail1,cfail4))]
1188 trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> { }
1189
1190 #[cfg(not(any(cfail1,cfail4)))]
1191 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1192 #[rustc_clean(cfg="cfail3")]
1193 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1194 #[rustc_clean(cfg="cfail6")]
1195 trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
1196
1197
1198
1199 // Add lifetime bound to type parameter of trait in where clause
1200 #[cfg(any(cfail1,cfail4))]
1201 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { }
1202
1203 #[cfg(not(any(cfail1,cfail4)))]
1204 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1205 #[rustc_clean(cfg="cfail3")]
1206 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1207 #[rustc_clean(cfg="cfail6")]
1208 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
1209
1210
1211
1212 // Add lifetime bound to lifetime parameter of trait in where clause
1213 #[cfg(any(cfail1,cfail4))]
1214 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { }
1215
1216 #[cfg(not(any(cfail1,cfail4)))]
1217 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1218 #[rustc_clean(cfg="cfail3")]
1219 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1220 #[rustc_clean(cfg="cfail6")]
1221 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { }
1222
1223
1224
1225 // Add builtin bound to type parameter of trait in where clause
1226 #[cfg(any(cfail1,cfail4))]
1227 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> { }
1228
1229 #[cfg(not(any(cfail1,cfail4)))]
1230 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1231 #[rustc_clean(cfg="cfail3")]
1232 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1233 #[rustc_clean(cfg="cfail6")]
1234 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
1235
1236
1237
1238 // Add second trait bound to type parameter of trait in where clause
1239 #[cfg(any(cfail1,cfail4))]
1240 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
1241
1242 #[cfg(not(any(cfail1,cfail4)))]
1243 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1244 #[rustc_clean(cfg="cfail3")]
1245 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1246 #[rustc_clean(cfg="cfail6")]
1247 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
1248     where T: ReferencedTrait0 + ReferencedTrait1 { }
1249
1250
1251
1252 // Add second lifetime bound to type parameter of trait in where clause
1253 #[cfg(any(cfail1,cfail4))]
1254 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { }
1255
1256 #[cfg(not(any(cfail1,cfail4)))]
1257 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
1258 #[rustc_clean(cfg="cfail3")]
1259 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
1260 #[rustc_clean(cfg="cfail6")]
1261 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { }
1262
1263
1264
1265 // Add second lifetime bound to lifetime parameter of trait in where clause
1266 #[cfg(any(cfail1,cfail4))]
1267 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { }
1268
1269 #[cfg(not(any(cfail1,cfail4)))]
1270 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1271 #[rustc_clean(cfg="cfail3")]
1272 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1273 #[rustc_clean(cfg="cfail6")]
1274 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { }
1275
1276
1277
1278 // Add second builtin bound to type parameter of trait in where clause
1279 #[cfg(any(cfail1,cfail4))]
1280 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
1281
1282 #[cfg(not(any(cfail1,cfail4)))]
1283 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1284 #[rustc_clean(cfg="cfail3")]
1285 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1286 #[rustc_clean(cfg="cfail6")]
1287 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { }
1288
1289
1290 // Change return type of method indirectly by modifying a use statement
1291 mod change_return_type_of_method_indirectly_use {
1292     #[cfg(any(cfail1,cfail4))]
1293     use super::ReferenceType0 as ReturnType;
1294     #[cfg(not(any(cfail1,cfail4)))]
1295     use super::ReferenceType1 as ReturnType;
1296
1297     #[rustc_clean(cfg="cfail2")]
1298     #[rustc_clean(cfg="cfail3")]
1299     #[rustc_clean(cfg="cfail5")]
1300     #[rustc_clean(cfg="cfail6")]
1301     trait TraitChangeReturnType {
1302         #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")]
1303         #[rustc_clean(cfg="cfail3")]
1304         #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")]
1305         #[rustc_clean(cfg="cfail6")]
1306         fn method() -> ReturnType;
1307     }
1308 }
1309
1310
1311
1312 // Change type of method parameter indirectly by modifying a use statement
1313 mod change_method_parameter_type_indirectly_by_use {
1314     #[cfg(any(cfail1,cfail4))]
1315     use super::ReferenceType0 as ArgType;
1316     #[cfg(not(any(cfail1,cfail4)))]
1317     use super::ReferenceType1 as ArgType;
1318
1319     #[rustc_clean(cfg="cfail2")]
1320     #[rustc_clean(cfg="cfail3")]
1321     #[rustc_clean(cfg="cfail5")]
1322     #[rustc_clean(cfg="cfail6")]
1323     trait TraitChangeArgType {
1324         #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")]
1325         #[rustc_clean(cfg="cfail3")]
1326         #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail5")]
1327         #[rustc_clean(cfg="cfail6")]
1328         fn method(a: ArgType);
1329     }
1330 }
1331
1332
1333
1334 // Change trait bound of method type parameter indirectly by modifying a use statement
1335 mod change_method_parameter_type_bound_indirectly_by_use {
1336     #[cfg(any(cfail1,cfail4))]
1337     use super::ReferencedTrait0 as Bound;
1338     #[cfg(not(any(cfail1,cfail4)))]
1339     use super::ReferencedTrait1 as Bound;
1340
1341     #[rustc_clean(cfg="cfail2")]
1342     #[rustc_clean(cfg="cfail3")]
1343     #[rustc_clean(cfg="cfail5")]
1344     #[rustc_clean(cfg="cfail6")]
1345     trait TraitChangeBoundOfMethodTypeParameter {
1346         #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1347         #[rustc_clean(cfg="cfail3")]
1348         #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1349         #[rustc_clean(cfg="cfail6")]
1350         fn method<T: Bound>(a: T);
1351     }
1352 }
1353
1354
1355
1356 // Change trait bound of method type parameter in where clause indirectly
1357 // by modifying a use statement
1358 mod change_method_parameter_type_bound_indirectly_by_use_where {
1359     #[cfg(any(cfail1,cfail4))]
1360     use super::ReferencedTrait0 as Bound;
1361     #[cfg(not(any(cfail1,cfail4)))]
1362     use super::ReferencedTrait1 as Bound;
1363
1364     #[rustc_clean(cfg="cfail2")]
1365     #[rustc_clean(cfg="cfail3")]
1366     #[rustc_clean(cfg="cfail5")]
1367     #[rustc_clean(cfg="cfail6")]
1368     trait TraitChangeBoundOfMethodTypeParameterWhere {
1369         #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1370         #[rustc_clean(cfg="cfail3")]
1371         #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1372         #[rustc_clean(cfg="cfail6")]
1373         fn method<T>(a: T) where T: Bound;
1374     }
1375 }
1376
1377
1378
1379 // Change trait bound of trait type parameter indirectly by modifying a use statement
1380 mod change_method_type_parameter_bound_indirectly {
1381     #[cfg(any(cfail1,cfail4))]
1382     use super::ReferencedTrait0 as Bound;
1383     #[cfg(not(any(cfail1,cfail4)))]
1384     use super::ReferencedTrait1 as Bound;
1385
1386     #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1387     #[rustc_clean(cfg="cfail3")]
1388     #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1389     #[rustc_clean(cfg="cfail6")]
1390     trait TraitChangeTraitBound<T: Bound> {
1391         fn method(a: T);
1392     }
1393 }
1394
1395
1396
1397 // Change trait bound of trait type parameter in where clause indirectly
1398 // by modifying a use statement
1399 mod change_method_type_parameter_bound_indirectly_where {
1400     #[cfg(any(cfail1,cfail4))]
1401     use super::ReferencedTrait0 as Bound;
1402     #[cfg(not(any(cfail1,cfail4)))]
1403     use super::ReferencedTrait1 as Bound;
1404
1405     #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1406     #[rustc_clean(cfg="cfail3")]
1407     #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
1408     #[rustc_clean(cfg="cfail6")]
1409     trait TraitChangeTraitBoundWhere<T> where T: Bound {
1410         fn method(a: T);
1411     }
1412 }