1 // This test case tests the incremental compilation hash (ICH) implementation
2 // for trait definitions.
4 // The general pattern followed here is: Change one thing between rev1 and rev2
5 // and make sure that the hash has changed, then change nothing between rev2 and
6 // rev3 and make sure that the hash has not changed.
8 // We also test the ICH for trait definitions exported in metadata. Same as
9 // above, we want to make sure that the change between rev1 and rev2 also
10 // results in a change of the ICH for the trait's metadata, and that it stays
11 // the same between rev2 and rev3.
13 // build-pass (FIXME(62277): could be check-pass?)
14 // revisions: cfail1 cfail2 cfail3
15 // compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
18 #![feature(rustc_attrs)]
20 #![feature(associated_type_defaults)]
23 // Change trait visibility
25 trait TraitVisibility { }
28 #[rustc_clean(except="hir_owner", cfg="cfail2")]
29 #[rustc_clean(cfg="cfail3")]
30 pub trait TraitVisibility { }
34 // Change trait unsafety
36 trait TraitUnsafety { }
39 #[rustc_clean(except="hir_owner", cfg="cfail2")]
40 #[rustc_clean(cfg="cfail3")]
41 unsafe trait TraitUnsafety { }
47 trait TraitAddMethod {
51 #[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")]
52 #[rustc_clean(cfg="cfail3")]
53 pub trait TraitAddMethod {
59 // Change name of method
61 trait TraitChangeMethodName {
66 #[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")]
67 #[rustc_clean(cfg="cfail3")]
68 trait TraitChangeMethodName {
74 // Add return type to method
76 trait TraitAddReturnType {
81 #[rustc_clean(cfg="cfail2")]
82 #[rustc_clean(cfg="cfail3")]
83 trait TraitAddReturnType {
84 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
85 #[rustc_clean(cfg="cfail3")]
91 // Change return type of method
93 trait TraitChangeReturnType {
98 #[rustc_clean(cfg="cfail2")]
99 #[rustc_clean(cfg="cfail3")]
100 trait TraitChangeReturnType {
101 #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")]
102 #[rustc_clean(cfg="cfail3")]
108 // Add parameter to method
110 trait TraitAddParameterToMethod {
115 #[rustc_clean(cfg="cfail2")]
116 #[rustc_clean(cfg="cfail3")]
117 trait TraitAddParameterToMethod {
118 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
119 #[rustc_clean(cfg="cfail3")]
125 // Change name of method parameter
127 trait TraitChangeMethodParameterName {
129 fn with_default(x: i32) {}
133 #[rustc_clean(cfg="cfail2")]
134 #[rustc_clean(cfg="cfail3")]
135 trait TraitChangeMethodParameterName {
136 // FIXME(#38501) This should preferably always be clean.
137 #[rustc_clean(except="hir_owner", cfg="cfail2")]
138 #[rustc_clean(cfg="cfail3")]
141 #[rustc_clean(except="hir_owner_nodes,optimized_mir", cfg="cfail2")]
142 #[rustc_clean(cfg="cfail3")]
143 fn with_default(y: i32) {}
148 // Change type of method parameter (i32 => i64)
150 trait TraitChangeMethodParameterType {
155 #[rustc_clean(cfg="cfail2")]
156 #[rustc_clean(cfg="cfail3")]
157 trait TraitChangeMethodParameterType {
158 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
159 #[rustc_clean(cfg="cfail3")]
165 // Change type of method parameter (&i32 => &mut i32)
167 trait TraitChangeMethodParameterTypeRef {
172 #[rustc_clean(cfg="cfail2")]
173 #[rustc_clean(cfg="cfail3")]
174 trait TraitChangeMethodParameterTypeRef {
175 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
176 #[rustc_clean(cfg="cfail3")]
177 fn method(a: &mut i32);
182 // Change order of method parameters
184 trait TraitChangeMethodParametersOrder {
185 fn method(a: i32, b: i64);
189 #[rustc_clean(cfg="cfail2")]
190 #[rustc_clean(cfg="cfail3")]
191 trait TraitChangeMethodParametersOrder {
192 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
193 #[rustc_clean(cfg="cfail3")]
194 fn method(b: i64, a: i32);
199 // Add default implementation to method
201 trait TraitAddMethodAutoImplementation {
206 #[rustc_clean(except="hir_owner", cfg="cfail2")]
207 #[rustc_clean(cfg="cfail3")]
208 trait TraitAddMethodAutoImplementation {
209 #[rustc_clean(except="hir_owner,associated_item", cfg="cfail2")]
210 #[rustc_clean(cfg="cfail3")]
216 // Change order of methods
218 trait TraitChangeOrderOfMethods {
224 #[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")]
225 #[rustc_clean(cfg="cfail3")]
226 trait TraitChangeOrderOfMethods {
233 // Change mode of self parameter
235 trait TraitChangeModeSelfRefToMut {
240 #[rustc_clean(cfg="cfail2")]
241 #[rustc_clean(cfg="cfail3")]
242 trait TraitChangeModeSelfRefToMut {
243 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
244 #[rustc_clean(cfg="cfail3")]
245 fn method(&mut self);
251 trait TraitChangeModeSelfOwnToMut: Sized {
256 #[rustc_clean(cfg="cfail2")]
257 #[rustc_clean(cfg="cfail3")]
258 trait TraitChangeModeSelfOwnToMut: Sized {
259 #[rustc_clean(except="hir_owner,hir_owner_nodes,typeck,optimized_mir", cfg="cfail2")]
260 #[rustc_clean(cfg="cfail3")]
261 fn method(mut self) {}
267 trait TraitChangeModeSelfOwnToRef {
272 #[rustc_clean(cfg="cfail2")]
273 #[rustc_clean(cfg="cfail3")]
274 trait TraitChangeModeSelfOwnToRef {
275 #[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="cfail2")]
276 #[rustc_clean(cfg="cfail3")]
282 // Add unsafe modifier to method
284 trait TraitAddUnsafeModifier {
289 #[rustc_clean(cfg="cfail2")]
290 #[rustc_clean(cfg="cfail3")]
291 trait TraitAddUnsafeModifier {
292 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
293 #[rustc_clean(cfg="cfail3")]
299 // Add extern modifier to method
301 trait TraitAddExternModifier {
306 #[rustc_clean(cfg="cfail2")]
307 #[rustc_clean(cfg="cfail3")]
308 trait TraitAddExternModifier {
309 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
310 #[rustc_clean(cfg="cfail3")]
311 extern "C" fn method();
316 // Change extern "C" to extern "stdcall"
318 trait TraitChangeExternCToRustIntrinsic {
319 extern "C" fn method();
323 #[rustc_clean(cfg="cfail2")]
324 #[rustc_clean(cfg="cfail3")]
325 trait TraitChangeExternCToRustIntrinsic {
326 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
327 #[rustc_clean(cfg="cfail3")]
328 extern "stdcall" fn method();
333 // Add type parameter to method
335 trait TraitAddTypeParameterToMethod {
340 #[rustc_clean(cfg="cfail2")]
341 #[rustc_clean(cfg="cfail3")]
342 trait TraitAddTypeParameterToMethod {
343 #[rustc_clean(except="hir_owner,generics_of,predicates_of,type_of", cfg="cfail2")]
344 #[rustc_clean(cfg="cfail3")]
350 // Add lifetime parameter to method
352 trait TraitAddLifetimeParameterToMethod {
357 #[rustc_clean(cfg="cfail2")]
358 #[rustc_clean(cfg="cfail3")]
359 trait TraitAddLifetimeParameterToMethod {
360 #[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="cfail2")]
361 #[rustc_clean(cfg="cfail3")]
367 // dummy trait for bound
368 trait ReferencedTrait0 { }
369 trait ReferencedTrait1 { }
371 // Add trait bound to method type parameter
373 trait TraitAddTraitBoundToMethodTypeParameter {
378 #[rustc_clean(cfg="cfail2")]
379 #[rustc_clean(cfg="cfail3")]
380 trait TraitAddTraitBoundToMethodTypeParameter {
381 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
382 #[rustc_clean(cfg="cfail3")]
383 fn method<T: ReferencedTrait0>();
388 // Add builtin bound to method type parameter
390 trait TraitAddBuiltinBoundToMethodTypeParameter {
395 #[rustc_clean(cfg="cfail2")]
396 #[rustc_clean(cfg="cfail3")]
397 trait TraitAddBuiltinBoundToMethodTypeParameter {
398 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
399 #[rustc_clean(cfg="cfail3")]
400 fn method<T: Sized>();
405 // Add lifetime bound to method lifetime parameter
407 trait TraitAddLifetimeBoundToMethodLifetimeParameter {
408 fn method<'a, 'b>(a: &'a u32, b: &'b u32);
412 #[rustc_clean(cfg="cfail2")]
413 #[rustc_clean(cfg="cfail3")]
414 trait TraitAddLifetimeBoundToMethodLifetimeParameter {
416 except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of",
419 #[rustc_clean(cfg="cfail3")]
420 fn method<'a, 'b: 'a>(a: &'a u32, b: &'b u32);
425 // Add second trait bound to method type parameter
427 trait TraitAddSecondTraitBoundToMethodTypeParameter {
428 fn method<T: ReferencedTrait0>();
432 #[rustc_clean(cfg="cfail2")]
433 #[rustc_clean(cfg="cfail3")]
434 trait TraitAddSecondTraitBoundToMethodTypeParameter {
435 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
436 #[rustc_clean(cfg="cfail3")]
437 fn method<T: ReferencedTrait0 + ReferencedTrait1>();
442 // Add second builtin bound to method type parameter
444 trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
445 fn method<T: Sized>();
449 #[rustc_clean(cfg="cfail2")]
450 #[rustc_clean(cfg="cfail3")]
451 trait TraitAddSecondBuiltinBoundToMethodTypeParameter {
452 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
453 #[rustc_clean(cfg="cfail3")]
454 fn method<T: Sized + Sync>();
459 // Add second lifetime bound to method lifetime parameter
461 trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
462 fn method<'a, 'b, 'c: 'a>(a: &'a u32, b: &'b u32, c: &'c u32);
466 #[rustc_clean(cfg="cfail2")]
467 #[rustc_clean(cfg="cfail3")]
468 trait TraitAddSecondLifetimeBoundToMethodLifetimeParameter {
470 except="hir_owner,hir_owner_nodes,generics_of,predicates_of,fn_sig,type_of",
473 #[rustc_clean(cfg="cfail3")]
474 fn method<'a, 'b, 'c: 'a + 'b>(a: &'a u32, b: &'b u32, c: &'c u32);
479 // Add associated type
481 trait TraitAddAssociatedType {
483 #[rustc_clean(except="hir_owner", cfg="cfail2")]
484 #[rustc_clean(cfg="cfail3")]
489 #[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")]
490 #[rustc_clean(cfg="cfail3")]
491 trait TraitAddAssociatedType {
499 // Add trait bound to associated type
501 trait TraitAddTraitBoundToAssociatedType {
508 // Apparently the type bound contributes to the predicates of the trait, but
509 // does not change the associated item itself.
511 #[rustc_clean(cfg="cfail2")]
512 #[rustc_clean(cfg="cfail3")]
513 trait TraitAddTraitBoundToAssociatedType {
514 #[rustc_clean(except="hir_owner", cfg="cfail2")]
515 #[rustc_clean(cfg="cfail3")]
516 type Associated: ReferencedTrait0;
523 // Add lifetime bound to associated type
525 trait TraitAddLifetimeBoundToAssociatedType<'a> {
532 #[rustc_clean(cfg="cfail2")]
533 #[rustc_clean(cfg="cfail3")]
534 trait TraitAddLifetimeBoundToAssociatedType<'a> {
535 #[rustc_clean(except="hir_owner", cfg="cfail2")]
536 #[rustc_clean(cfg="cfail3")]
544 // Add default to associated type
546 trait TraitAddDefaultToAssociatedType {
553 #[rustc_clean(except="hir_owner", cfg="cfail2")]
554 #[rustc_clean(cfg="cfail3")]
555 trait TraitAddDefaultToAssociatedType {
556 #[rustc_clean(except="hir_owner,associated_item", cfg="cfail2")]
557 #[rustc_clean(cfg="cfail3")]
558 type Associated = ReferenceType0;
565 // Add associated constant
567 trait TraitAddAssociatedConstant {
572 #[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")]
573 #[rustc_clean(cfg="cfail3")]
574 trait TraitAddAssociatedConstant {
582 // Add initializer to associated constant
584 trait TraitAddInitializerToAssociatedConstant {
591 #[rustc_clean(except="hir_owner", cfg="cfail2")]
592 #[rustc_clean(cfg="cfail3")]
593 trait TraitAddInitializerToAssociatedConstant {
594 #[rustc_clean(except="hir_owner,associated_item", cfg="cfail2")]
595 #[rustc_clean(cfg="cfail3")]
596 const Value: u32 = 1;
598 #[rustc_clean(cfg="cfail2")]
599 #[rustc_clean(cfg="cfail3")]
605 // Change type of associated constant
607 trait TraitChangeTypeOfAssociatedConstant {
614 #[rustc_clean(cfg="cfail2")]
615 #[rustc_clean(cfg="cfail3")]
616 trait TraitChangeTypeOfAssociatedConstant {
617 #[rustc_clean(except="hir_owner,type_of", cfg="cfail2")]
618 #[rustc_clean(cfg="cfail3")]
621 #[rustc_clean(cfg="cfail2")]
622 #[rustc_clean(cfg="cfail3")]
630 trait TraitAddSuperTrait { }
633 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
634 #[rustc_clean(cfg="cfail3")]
635 trait TraitAddSuperTrait : ReferencedTrait0 { }
639 // Add builtin bound (Send or Copy)
641 trait TraitAddBuiltiBound { }
644 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
645 #[rustc_clean(cfg="cfail3")]
646 trait TraitAddBuiltiBound : Send { }
650 // Add 'static lifetime bound to trait
652 trait TraitAddStaticLifetimeBound { }
655 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
656 #[rustc_clean(cfg="cfail3")]
657 trait TraitAddStaticLifetimeBound : 'static { }
661 // Add super trait as second bound
663 trait TraitAddTraitAsSecondBound : ReferencedTrait0 { }
666 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
667 #[rustc_clean(cfg="cfail3")]
668 trait TraitAddTraitAsSecondBound : ReferencedTrait0 + ReferencedTrait1 { }
671 trait TraitAddTraitAsSecondBoundFromBuiltin : Send { }
674 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
675 #[rustc_clean(cfg="cfail3")]
676 trait TraitAddTraitAsSecondBoundFromBuiltin : Send + ReferencedTrait0 { }
680 // Add builtin bound as second bound
682 trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 { }
685 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
686 #[rustc_clean(cfg="cfail3")]
687 trait TraitAddBuiltinBoundAsSecondBound : ReferencedTrait0 + Send { }
690 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin : Send { }
693 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
694 #[rustc_clean(cfg="cfail3")]
695 trait TraitAddBuiltinBoundAsSecondBoundFromBuiltin: Send + Copy { }
699 // Add 'static bounds as second bound
701 trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 { }
704 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
705 #[rustc_clean(cfg="cfail3")]
706 trait TraitAddStaticBoundAsSecondBound : ReferencedTrait0 + 'static { }
709 trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send { }
712 #[rustc_clean(except="hir_owner,predicates_of", cfg="cfail2")]
713 #[rustc_clean(cfg="cfail3")]
714 trait TraitAddStaticBoundAsSecondBoundFromBuiltin : Send + 'static { }
718 // Add type parameter to trait
720 trait TraitAddTypeParameterToTrait { }
723 #[rustc_clean(except="hir_owner,generics_of,predicates_of", cfg="cfail2")]
724 #[rustc_clean(cfg="cfail3")]
725 trait TraitAddTypeParameterToTrait<T> { }
729 // Add lifetime parameter to trait
731 trait TraitAddLifetimeParameterToTrait { }
734 #[rustc_clean(except="hir_owner,generics_of,predicates_of", cfg="cfail2")]
735 #[rustc_clean(cfg="cfail3")]
736 trait TraitAddLifetimeParameterToTrait<'a> { }
740 // Add trait bound to type parameter of trait
742 trait TraitAddTraitBoundToTypeParameterOfTrait<T> { }
745 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
746 #[rustc_clean(cfg="cfail3")]
747 trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
751 // Add lifetime bound to type parameter of trait
753 trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { }
756 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
757 #[rustc_clean(cfg="cfail3")]
758 trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
762 // Add lifetime bound to lifetime parameter of trait
764 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a, 'b> { }
767 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
768 #[rustc_clean(cfg="cfail3")]
769 trait TraitAddLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b> { }
773 // Add builtin bound to type parameter of trait
775 trait TraitAddBuiltinBoundToTypeParameterOfTrait<T> { }
778 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
779 #[rustc_clean(cfg="cfail3")]
780 trait TraitAddBuiltinBoundToTypeParameterOfTrait<T: Send> { }
784 // Add second type parameter to trait
786 trait TraitAddSecondTypeParameterToTrait<T> { }
789 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
790 #[rustc_clean(cfg="cfail3")]
791 trait TraitAddSecondTypeParameterToTrait<T, S> { }
795 // Add second lifetime parameter to trait
797 trait TraitAddSecondLifetimeParameterToTrait<'a> { }
800 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
801 #[rustc_clean(cfg="cfail3")]
802 trait TraitAddSecondLifetimeParameterToTrait<'a, 'b> { }
806 // Add second trait bound to type parameter of trait
808 trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
811 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
812 #[rustc_clean(cfg="cfail3")]
813 trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + ReferencedTrait1> { }
817 // Add second lifetime bound to type parameter of trait
819 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { }
822 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
823 #[rustc_clean(cfg="cfail3")]
824 trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
828 // Add second lifetime bound to lifetime parameter of trait
830 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b, 'b, 'c> { }
833 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
834 #[rustc_clean(cfg="cfail3")]
835 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTrait<'a: 'b + 'c, 'b, 'c> { }
839 // Add second builtin bound to type parameter of trait
841 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send> { }
844 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
845 #[rustc_clean(cfg="cfail3")]
846 trait TraitAddSecondBuiltinBoundToTypeParameterOfTrait<T: Send + Sync> { }
850 struct ReferenceType0 {}
851 struct ReferenceType1 {}
855 // Add trait bound to type parameter of trait in where clause
857 trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> { }
860 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
861 #[rustc_clean(cfg="cfail3")]
862 trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
866 // Add lifetime bound to type parameter of trait in where clause
868 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { }
871 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
872 #[rustc_clean(cfg="cfail3")]
873 trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
877 // Add lifetime bound to lifetime parameter of trait in where clause
879 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> { }
882 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
883 #[rustc_clean(cfg="cfail3")]
884 trait TraitAddLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b> where 'a: 'b { }
888 // Add builtin bound to type parameter of trait in where clause
890 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> { }
893 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
894 #[rustc_clean(cfg="cfail3")]
895 trait TraitAddBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
899 // Add second trait bound to type parameter of trait in where clause
901 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0 { }
904 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
905 #[rustc_clean(cfg="cfail3")]
906 trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
907 where T: ReferencedTrait0 + ReferencedTrait1 { }
911 // Add second lifetime bound to type parameter of trait in where clause
913 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { }
916 #[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
917 #[rustc_clean(cfg="cfail3")]
918 trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { }
922 // Add second lifetime bound to lifetime parameter of trait in where clause
924 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b { }
927 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
928 #[rustc_clean(cfg="cfail3")]
929 trait TraitAddSecondLifetimeBoundToLifetimeParameterOfTraitWhere<'a, 'b, 'c> where 'a: 'b + 'c { }
933 // Add second builtin bound to type parameter of trait in where clause
935 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send { }
938 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
939 #[rustc_clean(cfg="cfail3")]
940 trait TraitAddSecondBuiltinBoundToTypeParameterOfTraitWhere<T> where T: Send + Sync { }
943 // Change return type of method indirectly by modifying a use statement
944 mod change_return_type_of_method_indirectly_use {
946 use super::ReferenceType0 as ReturnType;
948 use super::ReferenceType1 as ReturnType;
950 #[rustc_clean(cfg="cfail2")]
951 #[rustc_clean(cfg="cfail3")]
952 trait TraitChangeReturnType {
953 #[rustc_clean(except="hir_owner,hir_owner_nodes,fn_sig", cfg="cfail2")]
954 #[rustc_clean(cfg="cfail3")]
955 fn method() -> ReturnType;
961 // Change type of method parameter indirectly by modifying a use statement
962 mod change_method_parameter_type_indirectly_by_use {
964 use super::ReferenceType0 as ArgType;
966 use super::ReferenceType1 as ArgType;
968 #[rustc_clean(cfg="cfail2")]
969 #[rustc_clean(cfg="cfail3")]
970 trait TraitChangeArgType {
971 #[rustc_clean(except="hir_owner,fn_sig", cfg="cfail2")]
972 #[rustc_clean(cfg="cfail3")]
973 fn method(a: ArgType);
979 // Change trait bound of method type parameter indirectly by modifying a use statement
980 mod change_method_parameter_type_bound_indirectly_by_use {
982 use super::ReferencedTrait0 as Bound;
984 use super::ReferencedTrait1 as Bound;
986 #[rustc_clean(cfg="cfail2")]
987 #[rustc_clean(cfg="cfail3")]
988 trait TraitChangeBoundOfMethodTypeParameter {
989 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
990 #[rustc_clean(cfg="cfail3")]
991 fn method<T: Bound>(a: T);
997 // Change trait bound of method type parameter in where clause indirectly
998 // by modifying a use statement
999 mod change_method_parameter_type_bound_indirectly_by_use_where {
1001 use super::ReferencedTrait0 as Bound;
1003 use super::ReferencedTrait1 as Bound;
1005 #[rustc_clean(cfg="cfail2")]
1006 #[rustc_clean(cfg="cfail3")]
1007 trait TraitChangeBoundOfMethodTypeParameterWhere {
1008 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1009 #[rustc_clean(cfg="cfail3")]
1010 fn method<T>(a: T) where T: Bound;
1016 // Change trait bound of trait type parameter indirectly by modifying a use statement
1017 mod change_method_type_parameter_bound_indirectly {
1019 use super::ReferencedTrait0 as Bound;
1021 use super::ReferencedTrait1 as Bound;
1023 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1024 #[rustc_clean(cfg="cfail3")]
1025 trait TraitChangeTraitBound<T: Bound> {
1032 // Change trait bound of trait type parameter in where clause indirectly
1033 // by modifying a use statement
1034 mod change_method_type_parameter_bound_indirectly_where {
1036 use super::ReferencedTrait0 as Bound;
1038 use super::ReferencedTrait1 as Bound;
1040 #[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
1041 #[rustc_clean(cfg="cfail3")]
1042 trait TraitChangeTraitBoundWhere<T> where T: Bound {