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