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.
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.
12 // This test case tests the incremental compilation hash (ICH) implementation
13 // for trait definitions.
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.
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.
24 // must-compile-successfully
25 // revisions: cfail1 cfail2 cfail3
26 // compile-flags: -Z query-dep-graph
29 #![feature(rustc_attrs)]
31 #![feature(associated_type_defaults)]
32 #![feature(intrinsics)]
33 #![feature(associated_consts)]
36 // Change trait visibility --------------------------------------------------------
38 trait TraitVisibility { }
41 #[rustc_dirty(label="Hir", cfg="cfail2")]
42 #[rustc_clean(label="Hir", cfg="cfail3")]
43 #[rustc_metadata_clean(cfg="cfail3")]
44 pub trait TraitVisibility { }
48 // Change trait unsafety ----------------------------------------------------------
50 trait TraitUnsafety { }
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 { }
61 // Add method ---------------------------------------------------------------------
63 trait TraitAddMethod
{
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
{
77 // Change name of method ----------------------------------------------------------
79 trait TraitChangeMethodName
{
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
{
94 // Add return type to method ------------------------------------------------------
96 trait TraitAddReturnType
{
101 #[rustc_dirty(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
{
111 // Change return type of method ---------------------------------------------------
113 trait TraitChangeReturnType
{
118 #[rustc_dirty(label="Hir", cfg="cfail2")]
119 #[rustc_clean(label="Hir", cfg="cfail3")]
120 #[rustc_metadata_dirty(cfg="cfail2")]
121 #[rustc_metadata_clean(cfg="cfail3")]
122 trait TraitChangeReturnType
{
128 // Add parameter to method --------------------------------------------------------
130 trait TraitAddParameterToMethod
{
135 #[rustc_dirty(label="Hir", cfg="cfail2")]
136 #[rustc_clean(label="Hir", cfg="cfail3")]
137 #[rustc_metadata_dirty(cfg="cfail2")]
138 #[rustc_metadata_clean(cfg="cfail3")]
139 trait TraitAddParameterToMethod
{
145 // Change name of method parameter ------------------------------------------------
147 trait TraitChangeMethodParameterName
{
152 #[rustc_dirty(label="Hir", cfg="cfail2")]
153 #[rustc_clean(label="Hir", cfg="cfail3")]
154 #[rustc_metadata_dirty(cfg="cfail2")]
155 #[rustc_metadata_clean(cfg="cfail3")]
156 trait TraitChangeMethodParameterName
{
162 // Change type of method parameter (i32 => i64) -----------------------------------
164 trait TraitChangeMethodParameterType
{
169 #[rustc_dirty(label="Hir", cfg="cfail2")]
170 #[rustc_clean(label="Hir", cfg="cfail3")]
171 #[rustc_metadata_dirty(cfg="cfail2")]
172 #[rustc_metadata_clean(cfg="cfail3")]
173 trait TraitChangeMethodParameterType
{
179 // Change type of method parameter (&i32 => &mut i32) -----------------------------
181 trait TraitChangeMethodParameterTypeRef
{
186 #[rustc_dirty(label="Hir", cfg="cfail2")]
187 #[rustc_clean(label="Hir", cfg="cfail3")]
188 #[rustc_metadata_dirty(cfg="cfail2")]
189 #[rustc_metadata_clean(cfg="cfail3")]
190 trait TraitChangeMethodParameterTypeRef
{
191 fn method(a
: &mut i32);
196 // Change order of method parameters ----------------------------------------------
198 trait TraitChangeMethodParametersOrder
{
199 fn method(a
: i32, b
: i64);
203 #[rustc_dirty(label="Hir", cfg="cfail2")]
204 #[rustc_clean(label="Hir", cfg="cfail3")]
205 #[rustc_metadata_dirty(cfg="cfail2")]
206 #[rustc_metadata_clean(cfg="cfail3")]
207 trait TraitChangeMethodParametersOrder
{
208 fn method(b
: i64, a
: i32);
213 // Add default implementation to method -------------------------------------------
215 trait TraitAddMethodDefaultImplementation
{
220 #[rustc_dirty(label="Hir", cfg="cfail2")]
221 #[rustc_clean(label="Hir", cfg="cfail3")]
222 #[rustc_metadata_dirty(cfg="cfail2")]
223 #[rustc_metadata_clean(cfg="cfail3")]
224 trait TraitAddMethodDefaultImplementation
{
230 // Change order of methods --------------------------------------------------------
232 trait TraitChangeOrderOfMethods
{
238 #[rustc_dirty(label="Hir", cfg="cfail2")]
239 #[rustc_clean(label="Hir", cfg="cfail3")]
240 #[rustc_metadata_dirty(cfg="cfail2")]
241 #[rustc_metadata_clean(cfg="cfail3")]
242 trait TraitChangeOrderOfMethods
{
249 // Change mode of self parameter --------------------------------------------------
251 trait TraitChangeModeSelfRefToMut
{
256 #[rustc_dirty(label="Hir", cfg="cfail2")]
257 #[rustc_clean(label="Hir", cfg="cfail3")]
258 #[rustc_metadata_dirty(cfg="cfail2")]
259 #[rustc_metadata_clean(cfg="cfail3")]
260 trait TraitChangeModeSelfRefToMut
{
261 fn method(&mut self);
267 trait TraitChangeModeSelfOwnToMut
: Sized
{
272 #[rustc_dirty(label="Hir", cfg="cfail2")]
273 #[rustc_clean(label="Hir", cfg="cfail3")]
274 #[rustc_metadata_dirty(cfg="cfail2")]
275 #[rustc_metadata_clean(cfg="cfail3")]
276 trait TraitChangeModeSelfOwnToMut
: Sized
{
277 fn method(mut self) {}
283 trait TraitChangeModeSelfOwnToRef
{
288 #[rustc_dirty(label="Hir", cfg="cfail2")]
289 #[rustc_clean(label="Hir", cfg="cfail3")]
290 #[rustc_metadata_dirty(cfg="cfail2")]
291 #[rustc_metadata_clean(cfg="cfail3")]
292 trait TraitChangeModeSelfOwnToRef
{
298 // Add unsafe modifier to method --------------------------------------------------
300 trait TraitAddUnsafeModifier
{
305 #[rustc_dirty(label="Hir", cfg="cfail2")]
306 #[rustc_clean(label="Hir", cfg="cfail3")]
307 #[rustc_metadata_dirty(cfg="cfail2")]
308 #[rustc_metadata_clean(cfg="cfail3")]
309 trait TraitAddUnsafeModifier
{
315 // Add extern modifier to method --------------------------------------------------
317 trait TraitAddExternModifier
{
322 #[rustc_dirty(label="Hir", cfg="cfail2")]
323 #[rustc_clean(label="Hir", cfg="cfail3")]
324 #[rustc_metadata_dirty(cfg="cfail2")]
325 #[rustc_metadata_clean(cfg="cfail3")]
326 trait TraitAddExternModifier
{
332 // Change extern "C" to extern "rust-intrinsic" -----------------------------------
334 trait TraitChangeExternCToRustIntrinsic
{
335 extern "C" fn method();
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 trait TraitChangeExternCToRustIntrinsic
{
344 extern "rust-intrinsic" fn method();
349 // Add type parameter to method ---------------------------------------------------
351 trait TraitAddTypeParameterToMethod
{
356 #[rustc_dirty(label="Hir", cfg="cfail2")]
357 #[rustc_clean(label="Hir", cfg="cfail3")]
358 #[rustc_metadata_dirty(cfg="cfail2")]
359 #[rustc_metadata_clean(cfg="cfail3")]
360 trait TraitAddTypeParameterToMethod
{
366 // Add lifetime parameter to method -----------------------------------------------
368 trait TraitAddLifetimeParameterToMethod
{
373 #[rustc_dirty(label="Hir", cfg="cfail2")]
374 #[rustc_clean(label="Hir", cfg="cfail3")]
375 #[rustc_metadata_dirty(cfg="cfail2")]
376 #[rustc_metadata_clean(cfg="cfail3")]
377 trait TraitAddLifetimeParameterToMethod
{
383 // dummy trait for bound
384 trait ReferencedTrait0 { }
385 trait ReferencedTrait1 { }
387 // Add trait bound to method type parameter ---------------------------------------
389 trait TraitAddTraitBoundToMethodTypeParameter
{
394 #[rustc_dirty(label="Hir", cfg="cfail2")]
395 #[rustc_clean(label="Hir", cfg="cfail3")]
396 #[rustc_metadata_dirty(cfg="cfail2")]
397 #[rustc_metadata_clean(cfg="cfail3")]
398 trait TraitAddTraitBoundToMethodTypeParameter
{
399 fn method
<T
: ReferencedTrait0
>();
404 // Add builtin bound to method type parameter -------------------------------------
406 trait TraitAddBuiltinBoundToMethodTypeParameter
{
411 #[rustc_dirty(label="Hir", cfg="cfail2")]
412 #[rustc_clean(label="Hir", cfg="cfail3")]
413 #[rustc_metadata_dirty(cfg="cfail2")]
414 #[rustc_metadata_clean(cfg="cfail3")]
415 trait TraitAddBuiltinBoundToMethodTypeParameter
{
416 fn method
<T
: Sized
>();
421 // Add lifetime bound to method lifetime parameter ------------------------------------
423 trait TraitAddLifetimeBoundToMethodLifetimeParameter
{
424 fn method
<'a
, 'b
>(a
: &'a
u32, b
: &'b
u32);
428 #[rustc_dirty(label="Hir", cfg="cfail2")]
429 #[rustc_clean(label="Hir", cfg="cfail3")]
430 #[rustc_metadata_dirty(cfg="cfail2")]
431 #[rustc_metadata_clean(cfg="cfail3")]
432 trait TraitAddLifetimeBoundToMethodLifetimeParameter
{
433 fn method
<'a
, 'b
: 'a
>(a
: &'a
u32, b
: &'b
u32);
438 // Add second trait bound to method type parameter --------------------------------
440 trait TraitAddSecondTraitBoundToMethodTypeParameter
{
441 fn method
<T
: ReferencedTrait0
>();
445 #[rustc_dirty(label="Hir", cfg="cfail2")]
446 #[rustc_clean(label="Hir", cfg="cfail3")]
447 #[rustc_metadata_dirty(cfg="cfail2")]
448 #[rustc_metadata_clean(cfg="cfail3")]
449 trait TraitAddSecondTraitBoundToMethodTypeParameter
{
450 fn method
<T
: ReferencedTrait0
+ ReferencedTrait1
>();
455 // Add second builtin bound to method type parameter ------------------------------
457 trait TraitAddSecondBuiltinBoundToMethodTypeParameter
{
458 fn method
<T
: Sized
>();
462 #[rustc_dirty(label="Hir", cfg="cfail2")]
463 #[rustc_clean(label="Hir", cfg="cfail3")]
464 #[rustc_metadata_dirty(cfg="cfail2")]
465 #[rustc_metadata_clean(cfg="cfail3")]
466 trait TraitAddSecondBuiltinBoundToMethodTypeParameter
{
467 fn method
<T
: Sized
+ Sync
>();
472 // Add second lifetime bound to method lifetime parameter -----------------------------
474 trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter
{
475 fn method
<'a
, 'b
, 'c
: 'a
>(a
: &'a
u32, b
: &'b
u32, c
: &'c
u32);
479 #[rustc_dirty(label="Hir", cfg="cfail2")]
480 #[rustc_clean(label="Hir", cfg="cfail3")]
481 #[rustc_metadata_dirty(cfg="cfail2")]
482 #[rustc_metadata_clean(cfg="cfail3")]
483 trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter
{
484 fn method
<'a
, 'b
, 'c
: 'a
+ 'b
>(a
: &'a
u32, b
: &'b
u32, c
: &'c
u32);
489 // Add associated type ------------------------------------------------------------
491 trait TraitAddAssociatedType
{
496 #[rustc_dirty(label="Hir", cfg="cfail2")]
497 #[rustc_clean(label="Hir", cfg="cfail3")]
498 #[rustc_metadata_dirty(cfg="cfail2")]
499 #[rustc_metadata_clean(cfg="cfail3")]
500 trait TraitAddAssociatedType
{
508 // Add trait bound to associated type ---------------------------------------------
510 trait TraitAddTraitBoundToAssociatedType
{
517 #[rustc_dirty(label="Hir", cfg="cfail2")]
518 #[rustc_clean(label="Hir", cfg="cfail3")]
519 #[rustc_metadata_dirty(cfg="cfail2")]
520 #[rustc_metadata_clean(cfg="cfail3")]
521 trait TraitAddTraitBoundToAssociatedType
{
522 type Associated
: ReferencedTrait0
;
529 // Add lifetime bound to associated type ------------------------------------------
531 trait TraitAddLifetimeBoundToAssociatedType
<'a
> {
538 #[rustc_dirty(label="Hir", cfg="cfail2")]
539 #[rustc_clean(label="Hir", cfg="cfail3")]
540 #[rustc_metadata_dirty(cfg="cfail2")]
541 #[rustc_metadata_clean(cfg="cfail3")]
542 trait TraitAddLifetimeBoundToAssociatedType
<'a
> {
550 // Add default to associated type -------------------------------------------------
552 trait TraitAddDefaultToAssociatedType
{
559 #[rustc_dirty(label="Hir", cfg="cfail2")]
560 #[rustc_clean(label="Hir", cfg="cfail3")]
561 #[rustc_metadata_dirty(cfg="cfail2")]
562 #[rustc_metadata_clean(cfg="cfail3")]
563 trait TraitAddDefaultToAssociatedType
{
564 type Associated
= ReferenceType0
;
571 // Add associated constant --------------------------------------------------------
573 trait TraitAddAssociatedConstant
{
578 #[rustc_dirty(label="Hir", cfg="cfail2")]
579 #[rustc_clean(label="Hir", cfg="cfail3")]
580 #[rustc_metadata_dirty(cfg="cfail2")]
581 #[rustc_metadata_clean(cfg="cfail3")]
582 trait TraitAddAssociatedConstant
{
590 // Add initializer to associated constant -----------------------------------------
592 trait TraitAddInitializerToAssociatedConstant
{
599 #[rustc_dirty(label="Hir", cfg="cfail2")]
600 #[rustc_clean(label="Hir", cfg="cfail3")]
601 #[rustc_metadata_dirty(cfg="cfail2")]
602 #[rustc_metadata_clean(cfg="cfail3")]
603 trait TraitAddInitializerToAssociatedConstant
{
604 const Value
: u32 = 1;
611 // Change type of associated constant ---------------------------------------------
613 trait TraitChangeTypeOfAssociatedConstant
{
620 #[rustc_dirty(label="Hir", cfg="cfail2")]
621 #[rustc_clean(label="Hir", cfg="cfail3")]
622 #[rustc_metadata_dirty(cfg="cfail2")]
623 #[rustc_metadata_clean(cfg="cfail3")]
624 trait TraitChangeTypeOfAssociatedConstant
{
632 // Add super trait ----------------------------------------------------------------
634 trait TraitAddSuperTrait { }
637 #[rustc_dirty(label="Hir", cfg="cfail2")]
638 #[rustc_clean(label="Hir", cfg="cfail3")]
639 #[rustc_metadata_dirty(cfg="cfail2")]
640 #[rustc_metadata_clean(cfg="cfail3")]
641 trait TraitAddSuperTrait
: ReferencedTrait0 { }
645 // Add builtin bound (Send or Copy) -----------------------------------------------
647 trait TraitAddBuiltiBound { }
650 #[rustc_dirty(label="Hir", cfg="cfail2")]
651 #[rustc_clean(label="Hir", cfg="cfail3")]
652 #[rustc_metadata_dirty(cfg="cfail2")]
653 #[rustc_metadata_clean(cfg="cfail3")]
654 trait TraitAddBuiltiBound
: Send { }
658 // Add 'static lifetime bound to trait --------------------------------------------
660 trait TraitAddStaticLifetimeBound { }
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 TraitAddStaticLifetimeBound
: '
static { }
671 // Add super trait as second bound ------------------------------------------------
673 trait TraitAddTraitAsSecondBound
: ReferencedTrait0 { }
676 #[rustc_dirty(label="Hir", cfg="cfail2")]
677 #[rustc_clean(label="Hir", cfg="cfail3")]
678 #[rustc_metadata_dirty(cfg="cfail2")]
679 #[rustc_metadata_clean(cfg="cfail3")]
680 trait TraitAddTraitAsSecondBound
: ReferencedTrait0
+ ReferencedTrait1 { }
683 trait TraitAddTraitAsSecondBoundFromBuiltin
: Send { }
686 #[rustc_dirty(label="Hir", cfg="cfail2")]
687 #[rustc_clean(label="Hir", cfg="cfail3")]
688 #[rustc_metadata_dirty(cfg="cfail2")]
689 #[rustc_metadata_clean(cfg="cfail3")]
690 trait TraitAddTraitAsSecondBoundFromBuiltin
: Send
+ ReferencedTrait0 { }
694 // Add builtin bound as second bound ----------------------------------------------
696 trait TraitAddBuiltinBoundAsSecondBound
: ReferencedTrait0 { }
699 #[rustc_dirty(label="Hir", cfg="cfail2")]
700 #[rustc_clean(label="Hir", cfg="cfail3")]
701 #[rustc_metadata_dirty(cfg="cfail2")]
702 #[rustc_metadata_clean(cfg="cfail3")]
703 trait TraitAddBuiltinBoundAsSecondBound
: ReferencedTrait0
+ Send { }
706 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin
: Send { }
709 #[rustc_dirty(label="Hir", cfg="cfail2")]
710 #[rustc_clean(label="Hir", cfg="cfail3")]
711 #[rustc_metadata_dirty(cfg="cfail2")]
712 #[rustc_metadata_clean(cfg="cfail3")]
713 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin
: Send
+ Copy { }
717 // Add 'static bounds as second bound ---------------------------------------------
719 trait TraitAddStaticBoundAsSecondBound
: ReferencedTrait0 { }
722 #[rustc_dirty(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 TraitAddStaticBoundAsSecondBound
: ReferencedTrait0
+ '
static { }
729 trait TraitAddStaticBoundAsSecondBoundFromBuiltin
: Send { }
732 #[rustc_dirty(label="Hir", cfg="cfail2")]
733 #[rustc_clean(label="Hir", cfg="cfail3")]
734 #[rustc_metadata_dirty(cfg="cfail2")]
735 #[rustc_metadata_clean(cfg="cfail3")]
736 trait TraitAddStaticBoundAsSecondBoundFromBuiltin
: Send
+ '
static { }
740 // Add type parameter to trait ----------------------------------------------------
742 trait TraitAddTypeParameterToTrait { }
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 TraitAddTypeParameterToTrait
<T
> { }
753 // Add lifetime parameter to trait ------------------------------------------------
755 trait TraitAddLifetimeParameterToTrait { }
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 TraitAddLifetimeParameterToTrait
<'a
> { }
766 // Add trait bound to type parameter of trait -------------------------------------
768 trait TraitAddTraitBoundToTypeParameterOfTrait
<T
> { }
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 TraitAddTraitBoundToTypeParameterOfTrait
<T
: ReferencedTrait0
> { }
779 // Add lifetime bound to type parameter of trait ----------------------------------
781 trait TraitAddLifetimeBoundToTypeParameterOfTrait
<'a
, T
> { }
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 TraitAddLifetimeBoundToTypeParameterOfTrait
<'a
, T
: 'a
> { }
792 // Add lifetime bound to lifetime parameter of trait ------------------------------
794 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait
<'a
, 'b
> { }
797 #[rustc_dirty(label="Hir", cfg="cfail2")]
798 #[rustc_clean(label="Hir", cfg="cfail3")]
799 #[rustc_metadata_dirty(cfg="cfail2")]
800 #[rustc_metadata_clean(cfg="cfail3")]
801 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait
<'a
: 'b
, 'b
> { }
805 // Add builtin bound to type parameter of trait -----------------------------------
807 trait TraitAddBuiltinBoundToTypeParameterOfTrait
<T
> { }
810 #[rustc_dirty(label="Hir", cfg="cfail2")]
811 #[rustc_clean(label="Hir", cfg="cfail3")]
812 #[rustc_metadata_dirty(cfg="cfail2")]
813 #[rustc_metadata_clean(cfg="cfail3")]
814 trait TraitAddBuiltinBoundToTypeParameterOfTrait
<T
: Send
> { }
818 // Add second type parameter to trait ---------------------------------------------
820 trait TraitAddSecondTypeParameterToTrait
<T
> { }
823 #[rustc_dirty(label="Hir", cfg="cfail2")]
824 #[rustc_clean(label="Hir", cfg="cfail3")]
825 #[rustc_metadata_dirty(cfg="cfail2")]
826 #[rustc_metadata_clean(cfg="cfail3")]
827 trait TraitAddSecondTypeParameterToTrait
<T
, S
> { }
831 // Add second lifetime parameter to trait -----------------------------------------
833 trait TraitAddSecondLifetimeParameterToTrait
<'a
> { }
836 #[rustc_dirty(label="Hir", cfg="cfail2")]
837 #[rustc_clean(label="Hir", cfg="cfail3")]
838 #[rustc_metadata_dirty(cfg="cfail2")]
839 #[rustc_metadata_clean(cfg="cfail3")]
840 trait TraitAddSecondLifetimeParameterToTrait
<'a
, 'b
> { }
844 // Add second trait bound to type parameter of trait ------------------------------
846 trait TraitAddSecondTraitBoundToTypeParameterOfTrait
<T
: ReferencedTrait0
> { }
849 #[rustc_dirty(label="Hir", cfg="cfail2")]
850 #[rustc_clean(label="Hir", cfg="cfail3")]
851 #[rustc_metadata_dirty(cfg="cfail2")]
852 #[rustc_metadata_clean(cfg="cfail3")]
853 trait TraitAddSecondTraitBoundToTypeParameterOfTrait
<T
: ReferencedTrait0
+ ReferencedTrait1
> { }
857 // Add second lifetime bound to type parameter of trait ---------------------------
859 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait
<'a
, 'b
, T
: 'a
> { }
862 #[rustc_dirty(label="Hir", cfg="cfail2")]
863 #[rustc_clean(label="Hir", cfg="cfail3")]
864 #[rustc_metadata_dirty(cfg="cfail2")]
865 #[rustc_metadata_clean(cfg="cfail3")]
866 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait
<'a
, 'b
, T
: 'a
+ 'b
> { }
870 // Add second lifetime bound to lifetime parameter of trait------------------------
872 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait
<'a
: 'b
, 'b
, 'c
> { }
875 #[rustc_dirty(label="Hir", cfg="cfail2")]
876 #[rustc_clean(label="Hir", cfg="cfail3")]
877 #[rustc_metadata_dirty(cfg="cfail2")]
878 #[rustc_metadata_clean(cfg="cfail3")]
879 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait
<'a
: 'b
+ 'c
, 'b
, 'c
> { }
883 // Add second builtin bound to type parameter of trait ----------------------------
885 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait
<T
: Send
> { }
888 #[rustc_dirty(label="Hir", cfg="cfail2")]
889 #[rustc_clean(label="Hir", cfg="cfail3")]
890 #[rustc_metadata_dirty(cfg="cfail2")]
891 #[rustc_metadata_clean(cfg="cfail3")]
892 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait
<T
: Send
+ Sync
> { }
896 // --------------------------------------------------------------------------------
897 struct ReferenceType0 {}
898 struct ReferenceType1 {}
902 // Add trait bound to type parameter of trait in where clause----------------------
904 trait TraitAddTraitBoundToTypeParameterOfTraitWhere
<T
> { }
907 #[rustc_dirty(label="Hir", cfg="cfail2")]
908 #[rustc_clean(label="Hir", cfg="cfail3")]
909 #[rustc_metadata_dirty(cfg="cfail2")]
910 #[rustc_metadata_clean(cfg="cfail3")]
911 trait TraitAddTraitBoundToTypeParameterOfTraitWhere
<T
> where T
: ReferencedTrait0 { }
915 // Add lifetime bound to type parameter of trait in where clause-------------------
917 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere
<'a
, T
> { }
920 #[rustc_dirty(label="Hir", cfg="cfail2")]
921 #[rustc_clean(label="Hir", cfg="cfail3")]
922 #[rustc_metadata_dirty(cfg="cfail2")]
923 #[rustc_metadata_clean(cfg="cfail3")]
924 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere
<'a
, T
> where T
: 'a { }
928 // Add lifetime bound to lifetime parameter of trait in where clause---------------
930 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere
<'a
, 'b
> { }
933 #[rustc_dirty(label="Hir", cfg="cfail2")]
934 #[rustc_clean(label="Hir", cfg="cfail3")]
935 #[rustc_metadata_dirty(cfg="cfail2")]
936 #[rustc_metadata_clean(cfg="cfail3")]
937 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere
<'a
, 'b
> where 'a
: 'b { }
941 // Add builtin bound to type parameter of trait in where clause--------------------
943 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere
<T
> { }
946 #[rustc_dirty(label="Hir", cfg="cfail2")]
947 #[rustc_clean(label="Hir", cfg="cfail3")]
948 #[rustc_metadata_dirty(cfg="cfail2")]
949 #[rustc_metadata_clean(cfg="cfail3")]
950 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere
<T
> where T
: Send { }
954 // Add second trait bound to type parameter of trait in where clause---------------
956 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere
<T
> where T
: ReferencedTrait0 { }
959 #[rustc_dirty(label="Hir", cfg="cfail2")]
960 #[rustc_clean(label="Hir", cfg="cfail3")]
961 #[rustc_metadata_dirty(cfg="cfail2")]
962 #[rustc_metadata_clean(cfg="cfail3")]
963 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere
<T
>
964 where T
: ReferencedTrait0
+ ReferencedTrait1 { }
968 // Add second lifetime bound to type parameter of trait in where clause------------
970 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere
<'a
, 'b
, T
> where T
: 'a { }
973 #[rustc_dirty(label="Hir", cfg="cfail2")]
974 #[rustc_clean(label="Hir", cfg="cfail3")]
975 #[rustc_metadata_dirty(cfg="cfail2")]
976 #[rustc_metadata_clean(cfg="cfail3")]
977 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere
<'a
, 'b
, T
> where T
: 'a
+ 'b { }
981 // Add second lifetime bound to lifetime parameter of trait in where clause--------
983 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere
<'a
, 'b
, 'c
> where 'a
: 'b { }
986 #[rustc_dirty(label="Hir", cfg="cfail2")]
987 #[rustc_clean(label="Hir", cfg="cfail3")]
988 #[rustc_metadata_dirty(cfg="cfail2")]
989 #[rustc_metadata_clean(cfg="cfail3")]
990 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere
<'a
, 'b
, 'c
> where 'a
: 'b
+ 'c { }
994 // Add second builtin bound to type parameter of trait in where clause-------------
996 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere
<T
> where T
: Send { }
999 #[rustc_dirty(label="Hir", cfg="cfail2")]
1000 #[rustc_clean(label="Hir", cfg="cfail3")]
1001 #[rustc_metadata_dirty(cfg="cfail2")]
1002 #[rustc_metadata_clean(cfg="cfail3")]
1003 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere
<T
> where T
: Send
+ Sync { }
1007 // EDIT: Some more cases ----------------------------------------------------------
1009 // Change return type of method indirectly by modifying a use statement------------
1010 mod change_return_type_of_method_indirectly_use
{
1012 use super::ReferenceType0
as ReturnType
;
1014 use super::ReferenceType1
as ReturnType
;
1016 #[rustc_dirty(label="Hir", cfg="cfail2")]
1017 #[rustc_clean(label="Hir", cfg="cfail3")]
1018 #[rustc_metadata_dirty(cfg="cfail2")]
1019 #[rustc_metadata_clean(cfg="cfail3")]
1020 trait TraitChangeReturnType
{
1021 fn method() -> ReturnType
;
1027 // Change type of method parameter indirectly by modifying a use statement---------
1028 mod change_method_parameter_type_indirectly_by_use
{
1030 use super::ReferenceType0
as ArgType
;
1032 use super::ReferenceType1
as ArgType
;
1034 #[rustc_dirty(label="Hir", cfg="cfail2")]
1035 #[rustc_clean(label="Hir", cfg="cfail3")]
1036 #[rustc_metadata_dirty(cfg="cfail2")]
1037 #[rustc_metadata_clean(cfg="cfail3")]
1038 trait TraitChangeArgType
{
1039 fn method(a
: ArgType
);
1045 // Change trait bound of method type parameter indirectly by modifying a use statement
1046 mod change_method_parameter_type_bound_indirectly_by_use
{
1048 use super::ReferencedTrait0
as Bound
;
1050 use super::ReferencedTrait1
as Bound
;
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 TraitChangeBoundOfMethodTypeParameter
{
1057 fn method
<T
: Bound
>(a
: T
);
1063 // Change trait bound of method type parameter in where clause indirectly
1064 // by modifying a use statement
1065 mod change_method_parameter_type_bound_indirectly_by_use_where
{
1067 use super::ReferencedTrait0
as Bound
;
1069 use super::ReferencedTrait1
as Bound
;
1071 #[rustc_dirty(label="Hir", cfg="cfail2")]
1072 #[rustc_clean(label="Hir", cfg="cfail3")]
1073 #[rustc_metadata_dirty(cfg="cfail2")]
1074 #[rustc_metadata_clean(cfg="cfail3")]
1075 trait TraitChangeBoundOfMethodTypeParameterWhere
{
1076 fn method
<T
>(a
: T
) where T
: Bound
;
1082 // Change trait bound of trait type parameter indirectly by modifying a use statement
1083 mod change_method_type_parameter_bound_indirectly
{
1085 use super::ReferencedTrait0
as Bound
;
1087 use super::ReferencedTrait1
as Bound
;
1089 #[rustc_dirty(label="Hir", cfg="cfail2")]
1090 #[rustc_clean(label="Hir", cfg="cfail3")]
1091 #[rustc_metadata_dirty(cfg="cfail2")]
1092 #[rustc_metadata_clean(cfg="cfail3")]
1093 trait TraitChangeTraitBound
<T
: Bound
> {
1100 // Change trait bound of trait type parameter in where clause indirectly
1101 // by modifying a use statement
1102 mod change_method_type_parameter_bound_indirectly_where
{
1104 use super::ReferencedTrait0
as Bound
;
1106 use super::ReferencedTrait1
as Bound
;
1108 #[rustc_dirty(label="Hir", cfg="cfail2")]
1109 #[rustc_clean(label="Hir", cfg="cfail3")]
1110 #[rustc_metadata_dirty(cfg="cfail2")]
1111 #[rustc_metadata_clean(cfg="cfail3")]
1112 trait TraitChangeTraitBoundWhere
<T
> where T
: Bound
{