]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/hashes/trait_defs.rs
Unignore u128 test for stage 0,1
[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_dirty(label="Hir", cfg="cfail2")]
320     #[rustc_clean(label="Hir", cfg="cfail3")]
321     #[rustc_metadata_dirty(cfg="cfail2")]
322     #[rustc_metadata_clean(cfg="cfail3")]
323     fn method(mut self) {}
324 }
325
326
327
328 #[cfg(cfail1)]
329 trait TraitChangeModeSelfOwnToRef {
330     fn method(self);
331 }
332
333 #[cfg(not(cfail1))]
334 #[rustc_clean(label="Hir", cfg="cfail2")]
335 #[rustc_clean(label="Hir", cfg="cfail3")]
336 #[rustc_metadata_dirty(cfg="cfail2")]
337 #[rustc_metadata_clean(cfg="cfail3")]
338 trait TraitChangeModeSelfOwnToRef {
339     #[rustc_dirty(label="Hir", cfg="cfail2")]
340     #[rustc_clean(label="Hir", cfg="cfail3")]
341     #[rustc_metadata_dirty(cfg="cfail2")]
342     #[rustc_metadata_clean(cfg="cfail3")]
343     fn method(&self);
344 }
345
346
347
348 // Add unsafe modifier to method --------------------------------------------------
349 #[cfg(cfail1)]
350 trait TraitAddUnsafeModifier {
351     fn method();
352 }
353
354 #[cfg(not(cfail1))]
355 #[rustc_clean(label="Hir", cfg="cfail2")]
356 #[rustc_clean(label="Hir", cfg="cfail3")]
357 #[rustc_metadata_dirty(cfg="cfail2")]
358 #[rustc_metadata_clean(cfg="cfail3")]
359 trait TraitAddUnsafeModifier {
360     #[rustc_dirty(label="Hir", cfg="cfail2")]
361     #[rustc_clean(label="Hir", cfg="cfail3")]
362     #[rustc_metadata_dirty(cfg="cfail2")]
363     #[rustc_metadata_clean(cfg="cfail3")]
364     unsafe fn method();
365 }
366
367
368
369 // Add extern modifier to method --------------------------------------------------
370 #[cfg(cfail1)]
371 trait TraitAddExternModifier {
372     fn method();
373 }
374
375 #[cfg(not(cfail1))]
376 #[rustc_clean(label="Hir", cfg="cfail2")]
377 #[rustc_clean(label="Hir", cfg="cfail3")]
378 #[rustc_metadata_dirty(cfg="cfail2")]
379 #[rustc_metadata_clean(cfg="cfail3")]
380 trait TraitAddExternModifier {
381     #[rustc_dirty(label="Hir", cfg="cfail2")]
382     #[rustc_clean(label="Hir", cfg="cfail3")]
383     #[rustc_metadata_dirty(cfg="cfail2")]
384     #[rustc_metadata_clean(cfg="cfail3")]
385     extern fn method();
386 }
387
388
389
390 // Change extern "C" to extern "rust-intrinsic" -----------------------------------
391 #[cfg(cfail1)]
392 trait TraitChangeExternCToRustIntrinsic {
393     extern "C" fn method();
394 }
395
396 #[cfg(not(cfail1))]
397 #[rustc_clean(label="Hir", cfg="cfail2")]
398 #[rustc_clean(label="Hir", cfg="cfail3")]
399 #[rustc_metadata_dirty(cfg="cfail2")]
400 #[rustc_metadata_clean(cfg="cfail3")]
401 trait TraitChangeExternCToRustIntrinsic {
402     #[rustc_dirty(label="Hir", cfg="cfail2")]
403     #[rustc_clean(label="Hir", cfg="cfail3")]
404     #[rustc_metadata_dirty(cfg="cfail2")]
405     #[rustc_metadata_clean(cfg="cfail3")]
406     extern "rust-intrinsic" fn method();
407 }
408
409
410
411 // Add type parameter to method ---------------------------------------------------
412 #[cfg(cfail1)]
413 trait TraitAddTypeParameterToMethod {
414     fn method();
415 }
416
417 #[cfg(not(cfail1))]
418 #[rustc_clean(label="Hir", cfg="cfail2")]
419 #[rustc_clean(label="Hir", cfg="cfail3")]
420 #[rustc_metadata_dirty(cfg="cfail2")]
421 #[rustc_metadata_clean(cfg="cfail3")]
422 trait TraitAddTypeParameterToMethod {
423     #[rustc_dirty(label="Hir", cfg="cfail2")]
424     #[rustc_clean(label="Hir", cfg="cfail3")]
425     #[rustc_metadata_dirty(cfg="cfail2")]
426     #[rustc_metadata_clean(cfg="cfail3")]
427     fn method<T>();
428 }
429
430
431
432 // Add lifetime parameter to method -----------------------------------------------
433 #[cfg(cfail1)]
434 trait TraitAddLifetimeParameterToMethod {
435     fn method();
436 }
437
438 #[cfg(not(cfail1))]
439 #[rustc_clean(label="Hir", cfg="cfail2")]
440 #[rustc_clean(label="Hir", cfg="cfail3")]
441 #[rustc_metadata_dirty(cfg="cfail2")]
442 #[rustc_metadata_clean(cfg="cfail3")]
443 trait TraitAddLifetimeParameterToMethod {
444     #[rustc_dirty(label="Hir", cfg="cfail2")]
445     #[rustc_clean(label="Hir", cfg="cfail3")]
446     #[rustc_metadata_dirty(cfg="cfail2")]
447     #[rustc_metadata_clean(cfg="cfail3")]
448     fn method<'a>();
449 }
450
451
452
453 // dummy trait for bound
454 trait ReferencedTrait0 { }
455 trait ReferencedTrait1 { }
456
457 // Add trait bound to method type parameter ---------------------------------------
458 #[cfg(cfail1)]
459 trait TraitAddTraitBoundToMethodTypeParameter {
460     fn method<T>();
461 }
462
463 #[cfg(not(cfail1))]
464 #[rustc_clean(label="Hir", cfg="cfail2")]
465 #[rustc_clean(label="Hir", cfg="cfail3")]
466 #[rustc_metadata_dirty(cfg="cfail2")]
467 #[rustc_metadata_clean(cfg="cfail3")]
468 trait TraitAddTraitBoundToMethodTypeParameter {
469     #[rustc_dirty(label="Hir", cfg="cfail2")]
470     #[rustc_clean(label="Hir", cfg="cfail3")]
471     #[rustc_metadata_dirty(cfg="cfail2")]
472     #[rustc_metadata_clean(cfg="cfail3")]
473     fn method<T: ReferencedTrait0>();
474 }
475
476
477
478 // Add builtin bound to method type parameter -------------------------------------
479 #[cfg(cfail1)]
480 trait TraitAddBuiltinBoundToMethodTypeParameter {
481     fn method<T>();
482 }
483
484 #[cfg(not(cfail1))]
485 #[rustc_clean(label="Hir", cfg="cfail2")]
486 #[rustc_clean(label="Hir", cfg="cfail3")]
487 #[rustc_metadata_dirty(cfg="cfail2")]
488 #[rustc_metadata_clean(cfg="cfail3")]
489 trait TraitAddBuiltinBoundToMethodTypeParameter {
490     #[rustc_dirty(label="Hir", cfg="cfail2")]
491     #[rustc_clean(label="Hir", cfg="cfail3")]
492     #[rustc_metadata_dirty(cfg="cfail2")]
493     #[rustc_metadata_clean(cfg="cfail3")]
494     fn method<T: Sized>();
495 }
496
497
498
499 // Add lifetime bound to method lifetime parameter ------------------------------------
500 #[cfg(cfail1)]
501 trait TraitAddLifetimeBoundToMethodLifetimeParameter {
502     fn method<'a, 'b>(a: &'a u32, b: &'b u32);
503 }
504
505 #[cfg(not(cfail1))]
506 #[rustc_clean(label="Hir", cfg="cfail2")]
507 #[rustc_clean(label="Hir", cfg="cfail3")]
508 #[rustc_metadata_dirty(cfg="cfail2")]
509 #[rustc_metadata_clean(cfg="cfail3")]
510 trait TraitAddLifetimeBoundToMethodLifetimeParameter {
511     #[rustc_dirty(label="Hir", cfg="cfail2")]
512     #[rustc_clean(label="Hir", cfg="cfail3")]
513     #[rustc_metadata_dirty(cfg="cfail2")]
514     #[rustc_metadata_clean(cfg="cfail3")]
515     fn method<'a, 'b: 'a>(a: &'a u32, b: &'b u32);
516 }
517
518
519
520 // Add second trait bound to method type parameter --------------------------------
521 #[cfg(cfail1)]
522 trait TraitAddSecondTraitBoundToMethodTypeParameter {
523     fn method<T: ReferencedTrait0>();
524 }
525
526 #[cfg(not(cfail1))]
527 #[rustc_clean(label="Hir", cfg="cfail2")]
528 #[rustc_clean(label="Hir", cfg="cfail3")]
529 #[rustc_metadata_dirty(cfg="cfail2")]
530 #[rustc_metadata_clean(cfg="cfail3")]
531 trait TraitAddSecondTraitBoundToMethodTypeParameter {
532     #[rustc_dirty(label="Hir", cfg="cfail2")]
533     #[rustc_clean(label="Hir", cfg="cfail3")]
534     #[rustc_metadata_dirty(cfg="cfail2")]
535     #[rustc_metadata_clean(cfg="cfail3")]
536     fn method<T: ReferencedTrait0 + ReferencedTrait1>();
537 }
538
539
540
541 // Add second builtin bound to method type parameter ------------------------------
542 #[cfg(cfail1)]
543 trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
544     fn method<T: Sized>();
545 }
546
547 #[cfg(not(cfail1))]
548 #[rustc_clean(label="Hir", cfg="cfail2")]
549 #[rustc_clean(label="Hir", cfg="cfail3")]
550 #[rustc_metadata_dirty(cfg="cfail2")]
551 #[rustc_metadata_clean(cfg="cfail3")]
552 trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
553     #[rustc_dirty(label="Hir", cfg="cfail2")]
554     #[rustc_clean(label="Hir", cfg="cfail3")]
555     #[rustc_metadata_dirty(cfg="cfail2")]
556     #[rustc_metadata_clean(cfg="cfail3")]
557     fn method<T: Sized + Sync>();
558 }
559
560
561
562 // Add second lifetime bound to method lifetime parameter -----------------------------
563 #[cfg(cfail1)]
564 trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
565     fn method<'a, 'b, 'c: 'a>(a: &'a u32, b: &'b u32, c: &'c u32);
566 }
567
568 #[cfg(not(cfail1))]
569 #[rustc_clean(label="Hir", cfg="cfail2")]
570 #[rustc_clean(label="Hir", cfg="cfail3")]
571 #[rustc_metadata_dirty(cfg="cfail2")]
572 #[rustc_metadata_clean(cfg="cfail3")]
573 trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
574     #[rustc_dirty(label="Hir", cfg="cfail2")]
575     #[rustc_clean(label="Hir", cfg="cfail3")]
576     #[rustc_metadata_dirty(cfg="cfail2")]
577     #[rustc_metadata_clean(cfg="cfail3")]
578     fn method<'a, 'b, 'c: 'a + 'b>(a: &'a u32, b: &'b u32, c: &'c u32);
579 }
580
581
582
583 // Add associated type ------------------------------------------------------------
584 #[cfg(cfail1)]
585 trait TraitAddAssociatedType {
586     fn mathod();
587 }
588
589 #[cfg(not(cfail1))]
590 #[rustc_dirty(label="Hir", cfg="cfail2")]
591 #[rustc_clean(label="Hir", cfg="cfail3")]
592 #[rustc_metadata_dirty(cfg="cfail2")]
593 #[rustc_metadata_clean(cfg="cfail3")]
594 trait TraitAddAssociatedType {
595     type Associated;
596
597     fn mathod();
598 }
599
600
601
602 // Add trait bound to associated type ---------------------------------------------
603 #[cfg(cfail1)]
604 trait TraitAddTraitBoundToAssociatedType {
605     type Associated;
606
607     fn mathod();
608 }
609
610 #[cfg(not(cfail1))]
611 #[rustc_clean(label="Hir", cfg="cfail2")]
612 #[rustc_clean(label="Hir", cfg="cfail3")]
613 #[rustc_metadata_dirty(cfg="cfail2")]
614 #[rustc_metadata_clean(cfg="cfail3")]
615 trait TraitAddTraitBoundToAssociatedType {
616     #[rustc_dirty(label="Hir", cfg="cfail2")]
617     #[rustc_clean(label="Hir", cfg="cfail3")]
618     #[rustc_metadata_dirty(cfg="cfail2")]
619     #[rustc_metadata_clean(cfg="cfail3")]
620     type Associated: ReferencedTrait0;
621
622     fn mathod();
623 }
624
625
626
627 // Add lifetime bound to associated type ------------------------------------------
628 #[cfg(cfail1)]
629 trait TraitAddLifetimeBoundToAssociatedType<'a> {
630     type Associated;
631
632     fn mathod();
633 }
634
635 #[cfg(not(cfail1))]
636 #[rustc_clean(label="Hir", cfg="cfail2")]
637 #[rustc_clean(label="Hir", cfg="cfail3")]
638 #[rustc_metadata_dirty(cfg="cfail2")]
639 #[rustc_metadata_clean(cfg="cfail3")]
640 trait TraitAddLifetimeBoundToAssociatedType<'a> {
641     #[rustc_dirty(label="Hir", cfg="cfail2")]
642     #[rustc_clean(label="Hir", cfg="cfail3")]
643     #[rustc_metadata_dirty(cfg="cfail2")]
644     #[rustc_metadata_clean(cfg="cfail3")]
645     type Associated: 'a;
646
647     fn mathod();
648 }
649
650
651
652 // Add default to associated type -------------------------------------------------
653 #[cfg(cfail1)]
654 trait TraitAddDefaultToAssociatedType {
655     type Associated;
656
657     fn mathod();
658 }
659
660 #[cfg(not(cfail1))]
661 #[rustc_dirty(label="Hir", cfg="cfail2")]
662 #[rustc_clean(label="Hir", cfg="cfail3")]
663 #[rustc_metadata_dirty(cfg="cfail2")]
664 #[rustc_metadata_clean(cfg="cfail3")]
665 trait TraitAddDefaultToAssociatedType {
666     type Associated = ReferenceType0;
667
668     fn mathod();
669 }
670
671
672
673 // Add associated constant --------------------------------------------------------
674 #[cfg(cfail1)]
675 trait TraitAddAssociatedConstant {
676     fn mathod();
677 }
678
679 #[cfg(not(cfail1))]
680 #[rustc_dirty(label="Hir", cfg="cfail2")]
681 #[rustc_clean(label="Hir", cfg="cfail3")]
682 #[rustc_metadata_dirty(cfg="cfail2")]
683 #[rustc_metadata_clean(cfg="cfail3")]
684 trait TraitAddAssociatedConstant {
685     const Value: u32;
686
687     fn mathod();
688 }
689
690
691
692 // Add initializer to associated constant -----------------------------------------
693 #[cfg(cfail1)]
694 trait TraitAddInitializerToAssociatedConstant {
695     const Value: u32;
696
697     fn mathod();
698 }
699
700 #[cfg(not(cfail1))]
701 #[rustc_dirty(label="Hir", cfg="cfail2")]
702 #[rustc_clean(label="Hir", cfg="cfail3")]
703 #[rustc_metadata_dirty(cfg="cfail2")]
704 #[rustc_metadata_clean(cfg="cfail3")]
705 trait TraitAddInitializerToAssociatedConstant {
706     const Value: u32 = 1;
707
708     fn mathod();
709 }
710
711
712
713 // Change type of associated constant ---------------------------------------------
714 #[cfg(cfail1)]
715 trait TraitChangeTypeOfAssociatedConstant {
716     const Value: u32;
717
718     fn mathod();
719 }
720
721 #[cfg(not(cfail1))]
722 #[rustc_clean(label="Hir", cfg="cfail2")]
723 #[rustc_clean(label="Hir", cfg="cfail3")]
724 #[rustc_metadata_dirty(cfg="cfail2")]
725 #[rustc_metadata_clean(cfg="cfail3")]
726 trait TraitChangeTypeOfAssociatedConstant {
727     #[rustc_dirty(label="Hir", cfg="cfail2")]
728     #[rustc_clean(label="Hir", cfg="cfail3")]
729     #[rustc_metadata_dirty(cfg="cfail2")]
730     #[rustc_metadata_clean(cfg="cfail3")]
731     const Value: f64;
732
733     fn mathod();
734 }
735
736
737
738 // Add super trait ----------------------------------------------------------------
739 #[cfg(cfail1)]
740 trait TraitAddSuperTrait { }
741
742 #[cfg(not(cfail1))]
743 #[rustc_dirty(label="Hir", cfg="cfail2")]
744 #[rustc_clean(label="Hir", cfg="cfail3")]
745 #[rustc_metadata_dirty(cfg="cfail2")]
746 #[rustc_metadata_clean(cfg="cfail3")]
747 trait TraitAddSuperTrait : ReferencedTrait0 { }
748
749
750
751 // Add builtin bound (Send or Copy) -----------------------------------------------
752 #[cfg(cfail1)]
753 trait TraitAddBuiltiBound { }
754
755 #[cfg(not(cfail1))]
756 #[rustc_dirty(label="Hir", cfg="cfail2")]
757 #[rustc_clean(label="Hir", cfg="cfail3")]
758 #[rustc_metadata_dirty(cfg="cfail2")]
759 #[rustc_metadata_clean(cfg="cfail3")]
760 trait TraitAddBuiltiBound : Send { }
761
762
763
764 // Add 'static lifetime bound to trait --------------------------------------------
765 #[cfg(cfail1)]
766 trait TraitAddStaticLifetimeBound { }
767
768 #[cfg(not(cfail1))]
769 #[rustc_dirty(label="Hir", cfg="cfail2")]
770 #[rustc_clean(label="Hir", cfg="cfail3")]
771 #[rustc_metadata_dirty(cfg="cfail2")]
772 #[rustc_metadata_clean(cfg="cfail3")]
773 trait TraitAddStaticLifetimeBound : 'static { }
774
775
776
777 // Add super trait as second bound ------------------------------------------------
778 #[cfg(cfail1)]
779 trait TraitAddTraitAsSecondBound : ReferencedTrait0 { }
780
781 #[cfg(not(cfail1))]
782 #[rustc_dirty(label="Hir", cfg="cfail2")]
783 #[rustc_clean(label="Hir", cfg="cfail3")]
784 #[rustc_metadata_dirty(cfg="cfail2")]
785 #[rustc_metadata_clean(cfg="cfail3")]
786 trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { }
787
788 #[cfg(cfail1)]
789 trait TraitAddTraitAsSecondBoundFromBuiltin : Send { }
790
791 #[cfg(not(cfail1))]
792 #[rustc_dirty(label="Hir", cfg="cfail2")]
793 #[rustc_clean(label="Hir", cfg="cfail3")]
794 #[rustc_metadata_dirty(cfg="cfail2")]
795 #[rustc_metadata_clean(cfg="cfail3")]
796 trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { }
797
798
799
800 // Add builtin bound as second bound ----------------------------------------------
801 #[cfg(cfail1)]
802 trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { }
803
804 #[cfg(not(cfail1))]
805 #[rustc_dirty(label="Hir", cfg="cfail2")]
806 #[rustc_clean(label="Hir", cfg="cfail3")]
807 #[rustc_metadata_dirty(cfg="cfail2")]
808 #[rustc_metadata_clean(cfg="cfail3")]
809 trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { }
810
811 #[cfg(cfail1)]
812 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { }
813
814 #[cfg(not(cfail1))]
815 #[rustc_dirty(label="Hir", cfg="cfail2")]
816 #[rustc_clean(label="Hir", cfg="cfail3")]
817 #[rustc_metadata_dirty(cfg="cfail2")]
818 #[rustc_metadata_clean(cfg="cfail3")]
819 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { }
820
821
822
823 // Add 'static bounds as second bound ---------------------------------------------
824 #[cfg(cfail1)]
825 trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { }
826
827 #[cfg(not(cfail1))]
828 #[rustc_dirty(label="Hir", cfg="cfail2")]
829 #[rustc_clean(label="Hir", cfg="cfail3")]
830 #[rustc_metadata_dirty(cfg="cfail2")]
831 #[rustc_metadata_clean(cfg="cfail3")]
832 trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { }
833
834 #[cfg(cfail1)]
835 trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { }
836
837 #[cfg(not(cfail1))]
838 #[rustc_dirty(label="Hir", cfg="cfail2")]
839 #[rustc_clean(label="Hir", cfg="cfail3")]
840 #[rustc_metadata_dirty(cfg="cfail2")]
841 #[rustc_metadata_clean(cfg="cfail3")]
842 trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { }
843
844
845
846 // Add type parameter to trait ----------------------------------------------------
847 #[cfg(cfail1)]
848 trait TraitAddTypeParameterToTrait { }
849
850 #[cfg(not(cfail1))]
851 #[rustc_dirty(label="Hir", cfg="cfail2")]
852 #[rustc_clean(label="Hir", cfg="cfail3")]
853 #[rustc_metadata_dirty(cfg="cfail2")]
854 #[rustc_metadata_clean(cfg="cfail3")]
855 trait TraitAddTypeParameterToTrait<T> { }
856
857
858
859 // Add lifetime parameter to trait ------------------------------------------------
860 #[cfg(cfail1)]
861 trait TraitAddLifetimeParameterToTrait { }
862
863 #[cfg(not(cfail1))]
864 #[rustc_dirty(label="Hir", cfg="cfail2")]
865 #[rustc_clean(label="Hir", cfg="cfail3")]
866 #[rustc_metadata_dirty(cfg="cfail2")]
867 #[rustc_metadata_clean(cfg="cfail3")]
868 trait TraitAddLifetimeParameterToTrait<'a> { }
869
870
871
872 // Add trait bound to type parameter of trait -------------------------------------
873 #[cfg(cfail1)]
874 trait TraitAddTraitBoundToTypeParameterOfTrait<T> { }
875
876 #[cfg(not(cfail1))]
877 #[rustc_dirty(label="Hir", cfg="cfail2")]
878 #[rustc_clean(label="Hir", cfg="cfail3")]
879 #[rustc_metadata_dirty(cfg="cfail2")]
880 #[rustc_metadata_clean(cfg="cfail3")]
881 trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
882
883
884
885 // Add lifetime bound to type parameter of trait ----------------------------------
886 #[cfg(cfail1)]
887 trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { }
888
889 #[cfg(not(cfail1))]
890 #[rustc_dirty(label="Hir", cfg="cfail2")]
891 #[rustc_clean(label="Hir", cfg="cfail3")]
892 #[rustc_metadata_dirty(cfg="cfail2")]
893 #[rustc_metadata_clean(cfg="cfail3")]
894 trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
895
896
897
898 // Add lifetime bound to lifetime parameter of trait ------------------------------
899 #[cfg(cfail1)]
900 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { }
901
902 #[cfg(not(cfail1))]
903 #[rustc_dirty(label="Hir", cfg="cfail2")]
904 #[rustc_clean(label="Hir", cfg="cfail3")]
905 #[rustc_metadata_dirty(cfg="cfail2")]
906 #[rustc_metadata_clean(cfg="cfail3")]
907 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { }
908
909
910
911 // Add builtin bound to type parameter of trait -----------------------------------
912 #[cfg(cfail1)]
913 trait TraitAddBuiltinBoundToTypeParameterOfTrait<T> { }
914
915 #[cfg(not(cfail1))]
916 #[rustc_dirty(label="Hir", cfg="cfail2")]
917 #[rustc_clean(label="Hir", cfg="cfail3")]
918 #[rustc_metadata_dirty(cfg="cfail2")]
919 #[rustc_metadata_clean(cfg="cfail3")]
920 trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { }
921
922
923
924 // Add second type parameter to trait ---------------------------------------------
925 #[cfg(cfail1)]
926 trait TraitAddSecondTypeParameterToTrait<T> { }
927
928 #[cfg(not(cfail1))]
929 #[rustc_dirty(label="Hir", cfg="cfail2")]
930 #[rustc_clean(label="Hir", cfg="cfail3")]
931 #[rustc_metadata_dirty(cfg="cfail2")]
932 #[rustc_metadata_clean(cfg="cfail3")]
933 trait TraitAddSecondTypeParameterToTrait<T, S> { }
934
935
936
937 // Add second lifetime parameter to trait -----------------------------------------
938 #[cfg(cfail1)]
939 trait TraitAddSecondLifetimeParameterToTrait<'a> { }
940
941 #[cfg(not(cfail1))]
942 #[rustc_dirty(label="Hir", cfg="cfail2")]
943 #[rustc_clean(label="Hir", cfg="cfail3")]
944 #[rustc_metadata_dirty(cfg="cfail2")]
945 #[rustc_metadata_clean(cfg="cfail3")]
946 trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { }
947
948
949
950 // Add second trait bound to type parameter of trait ------------------------------
951 #[cfg(cfail1)]
952 trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
953
954 #[cfg(not(cfail1))]
955 #[rustc_dirty(label="Hir", cfg="cfail2")]
956 #[rustc_clean(label="Hir", cfg="cfail3")]
957 #[rustc_metadata_dirty(cfg="cfail2")]
958 #[rustc_metadata_clean(cfg="cfail3")]
959 trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + ReferencedTrait1> { }
960
961
962
963 // Add second lifetime bound to type parameter of trait ---------------------------
964 #[cfg(cfail1)]
965 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { }
966
967 #[cfg(not(cfail1))]
968 #[rustc_dirty(label="Hir", cfg="cfail2")]
969 #[rustc_clean(label="Hir", cfg="cfail3")]
970 #[rustc_metadata_dirty(cfg="cfail2")]
971 #[rustc_metadata_clean(cfg="cfail3")]
972 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
973
974
975
976 // Add second lifetime bound to lifetime parameter of trait------------------------
977 #[cfg(cfail1)]
978 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { }
979
980 #[cfg(not(cfail1))]
981 #[rustc_dirty(label="Hir", cfg="cfail2")]
982 #[rustc_clean(label="Hir", cfg="cfail3")]
983 #[rustc_metadata_dirty(cfg="cfail2")]
984 #[rustc_metadata_clean(cfg="cfail3")]
985 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { }
986
987
988
989 // Add second builtin bound to type parameter of trait ----------------------------
990 #[cfg(cfail1)]
991 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send> { }
992
993 #[cfg(not(cfail1))]
994 #[rustc_dirty(label="Hir", cfg="cfail2")]
995 #[rustc_clean(label="Hir", cfg="cfail3")]
996 #[rustc_metadata_dirty(cfg="cfail2")]
997 #[rustc_metadata_clean(cfg="cfail3")]
998 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send + Sync> { }
999
1000
1001
1002 // --------------------------------------------------------------------------------
1003 struct ReferenceType0 {}
1004 struct ReferenceType1 {}
1005
1006
1007
1008 // Add trait bound to type parameter of trait in where clause----------------------
1009 #[cfg(cfail1)]
1010 trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> { }
1011
1012 #[cfg(not(cfail1))]
1013 #[rustc_dirty(label="Hir", cfg="cfail2")]
1014 #[rustc_clean(label="Hir", cfg="cfail3")]
1015 #[rustc_metadata_dirty(cfg="cfail2")]
1016 #[rustc_metadata_clean(cfg="cfail3")]
1017 trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
1018
1019
1020
1021 // Add lifetime bound to type parameter of trait in where clause-------------------
1022 #[cfg(cfail1)]
1023 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { }
1024
1025 #[cfg(not(cfail1))]
1026 #[rustc_dirty(label="Hir", cfg="cfail2")]
1027 #[rustc_clean(label="Hir", cfg="cfail3")]
1028 #[rustc_metadata_dirty(cfg="cfail2")]
1029 #[rustc_metadata_clean(cfg="cfail3")]
1030 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
1031
1032
1033
1034 // Add lifetime bound to lifetime parameter of trait in where clause---------------
1035 #[cfg(cfail1)]
1036 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { }
1037
1038 #[cfg(not(cfail1))]
1039 #[rustc_dirty(label="Hir", cfg="cfail2")]
1040 #[rustc_clean(label="Hir", cfg="cfail3")]
1041 #[rustc_metadata_dirty(cfg="cfail2")]
1042 #[rustc_metadata_clean(cfg="cfail3")]
1043 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { }
1044
1045
1046
1047 // Add builtin bound to type parameter of trait in where clause--------------------
1048 #[cfg(cfail1)]
1049 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> { }
1050
1051 #[cfg(not(cfail1))]
1052 #[rustc_dirty(label="Hir", cfg="cfail2")]
1053 #[rustc_clean(label="Hir", cfg="cfail3")]
1054 #[rustc_metadata_dirty(cfg="cfail2")]
1055 #[rustc_metadata_clean(cfg="cfail3")]
1056 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
1057
1058
1059
1060 // Add second trait bound to type parameter of trait in where clause---------------
1061 #[cfg(cfail1)]
1062 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
1063
1064 #[cfg(not(cfail1))]
1065 #[rustc_dirty(label="Hir", cfg="cfail2")]
1066 #[rustc_clean(label="Hir", cfg="cfail3")]
1067 #[rustc_metadata_dirty(cfg="cfail2")]
1068 #[rustc_metadata_clean(cfg="cfail3")]
1069 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
1070     where T: ReferencedTrait0 + ReferencedTrait1 { }
1071
1072
1073
1074 // Add second lifetime bound to type parameter of trait in where clause------------
1075 #[cfg(cfail1)]
1076 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { }
1077
1078 #[cfg(not(cfail1))]
1079 #[rustc_dirty(label="Hir", cfg="cfail2")]
1080 #[rustc_clean(label="Hir", cfg="cfail3")]
1081 #[rustc_metadata_dirty(cfg="cfail2")]
1082 #[rustc_metadata_clean(cfg="cfail3")]
1083 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { }
1084
1085
1086
1087 // Add second lifetime bound to lifetime parameter of trait in where clause--------
1088 #[cfg(cfail1)]
1089 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { }
1090
1091 #[cfg(not(cfail1))]
1092 #[rustc_dirty(label="Hir", cfg="cfail2")]
1093 #[rustc_clean(label="Hir", cfg="cfail3")]
1094 #[rustc_metadata_dirty(cfg="cfail2")]
1095 #[rustc_metadata_clean(cfg="cfail3")]
1096 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { }
1097
1098
1099
1100 // Add second builtin bound to type parameter of trait in where clause-------------
1101 #[cfg(cfail1)]
1102 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
1103
1104 #[cfg(not(cfail1))]
1105 #[rustc_dirty(label="Hir", cfg="cfail2")]
1106 #[rustc_clean(label="Hir", cfg="cfail3")]
1107 #[rustc_metadata_dirty(cfg="cfail2")]
1108 #[rustc_metadata_clean(cfg="cfail3")]
1109 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { }
1110
1111
1112
1113 // EDIT: Some more cases ----------------------------------------------------------
1114
1115 // Change return type of method indirectly by modifying a use statement------------
1116 mod change_return_type_of_method_indirectly_use {
1117     #[cfg(cfail1)]
1118     use super::ReferenceType0 as ReturnType;
1119     #[cfg(not(cfail1))]
1120     use super::ReferenceType1 as ReturnType;
1121
1122     #[rustc_clean(label="Hir", cfg="cfail2")]
1123     #[rustc_clean(label="Hir", cfg="cfail3")]
1124     #[rustc_metadata_dirty(cfg="cfail2")]
1125     #[rustc_metadata_clean(cfg="cfail3")]
1126     trait TraitChangeReturnType {
1127         #[rustc_dirty(label="Hir", cfg="cfail2")]
1128         #[rustc_clean(label="Hir", cfg="cfail3")]
1129         #[rustc_metadata_dirty(cfg="cfail2")]
1130         #[rustc_metadata_clean(cfg="cfail3")]
1131         fn method() -> ReturnType;
1132     }
1133 }
1134
1135
1136
1137 // Change type of method parameter indirectly by modifying a use statement---------
1138 mod change_method_parameter_type_indirectly_by_use {
1139     #[cfg(cfail1)]
1140     use super::ReferenceType0 as ArgType;
1141     #[cfg(not(cfail1))]
1142     use super::ReferenceType1 as ArgType;
1143
1144     #[rustc_clean(label="Hir", cfg="cfail2")]
1145     #[rustc_clean(label="Hir", cfg="cfail3")]
1146     #[rustc_metadata_dirty(cfg="cfail2")]
1147     #[rustc_metadata_clean(cfg="cfail3")]
1148     trait TraitChangeArgType {
1149         #[rustc_dirty(label="Hir", cfg="cfail2")]
1150         #[rustc_clean(label="Hir", cfg="cfail3")]
1151         #[rustc_metadata_dirty(cfg="cfail2")]
1152         #[rustc_metadata_clean(cfg="cfail3")]
1153         fn method(a: ArgType);
1154     }
1155 }
1156
1157
1158
1159 // Change trait bound of method type parameter indirectly by modifying a use statement
1160 mod change_method_parameter_type_bound_indirectly_by_use {
1161     #[cfg(cfail1)]
1162     use super::ReferencedTrait0 as Bound;
1163     #[cfg(not(cfail1))]
1164     use super::ReferencedTrait1 as Bound;
1165
1166     #[rustc_clean(label="Hir", cfg="cfail2")]
1167     #[rustc_clean(label="Hir", cfg="cfail3")]
1168     #[rustc_metadata_dirty(cfg="cfail2")]
1169     #[rustc_metadata_clean(cfg="cfail3")]
1170     trait TraitChangeBoundOfMethodTypeParameter {
1171         #[rustc_dirty(label="Hir", cfg="cfail2")]
1172         #[rustc_clean(label="Hir", cfg="cfail3")]
1173         #[rustc_metadata_dirty(cfg="cfail2")]
1174         #[rustc_metadata_clean(cfg="cfail3")]
1175         fn method<T: Bound>(a: T);
1176     }
1177 }
1178
1179
1180
1181 // Change trait bound of method type parameter in where clause indirectly
1182 // by modifying a use statement
1183 mod change_method_parameter_type_bound_indirectly_by_use_where {
1184     #[cfg(cfail1)]
1185     use super::ReferencedTrait0 as Bound;
1186     #[cfg(not(cfail1))]
1187     use super::ReferencedTrait1 as Bound;
1188
1189     #[rustc_clean(label="Hir", cfg="cfail2")]
1190     #[rustc_clean(label="Hir", cfg="cfail3")]
1191     #[rustc_metadata_dirty(cfg="cfail2")]
1192     #[rustc_metadata_clean(cfg="cfail3")]
1193     trait TraitChangeBoundOfMethodTypeParameterWhere {
1194         #[rustc_dirty(label="Hir", cfg="cfail2")]
1195         #[rustc_clean(label="Hir", cfg="cfail3")]
1196         #[rustc_metadata_dirty(cfg="cfail2")]
1197         #[rustc_metadata_clean(cfg="cfail3")]
1198         fn method<T>(a: T) where T: Bound;
1199     }
1200 }
1201
1202
1203
1204 // Change trait bound of trait type parameter indirectly by modifying a use statement
1205 mod change_method_type_parameter_bound_indirectly {
1206     #[cfg(cfail1)]
1207     use super::ReferencedTrait0 as Bound;
1208     #[cfg(not(cfail1))]
1209     use super::ReferencedTrait1 as Bound;
1210
1211     #[rustc_dirty(label="Hir", cfg="cfail2")]
1212     #[rustc_clean(label="Hir", cfg="cfail3")]
1213     #[rustc_metadata_dirty(cfg="cfail2")]
1214     #[rustc_metadata_clean(cfg="cfail3")]
1215     trait TraitChangeTraitBound<T: Bound> {
1216         fn method(a: T);
1217     }
1218 }
1219
1220
1221
1222 // Change trait bound of trait type parameter in where clause indirectly
1223 // by modifying a use statement
1224 mod change_method_type_parameter_bound_indirectly_where {
1225     #[cfg(cfail1)]
1226     use super::ReferencedTrait0 as Bound;
1227     #[cfg(not(cfail1))]
1228     use super::ReferencedTrait1 as Bound;
1229
1230     #[rustc_dirty(label="Hir", cfg="cfail2")]
1231     #[rustc_clean(label="Hir", cfg="cfail3")]
1232     #[rustc_metadata_dirty(cfg="cfail2")]
1233     #[rustc_metadata_clean(cfg="cfail3")]
1234     trait TraitChangeTraitBoundWhere<T> where T: Bound {
1235         fn method(a: T);
1236     }
1237 }