@@ -184,34 +184,6 @@ mod trait_visibility {
184184 }
185185}
186186
187- mod method_call_trait_path_disambig {
188- trait FirstTrait {
189- // FirstTrait::method
190- fn method ( & self ) -> bool {
191- true
192- }
193- }
194- trait SecondTrait {
195- // SecondTrait::method
196- fn method ( & self ) -> i64 {
197- 1
198- }
199- }
200- struct S ;
201- impl FirstTrait for S { }
202- impl SecondTrait for S { }
203-
204- fn _test ( ) {
205- let s = S ;
206-
207- let _b1 = FirstTrait :: method ( & s) ; // $ type=_b1:bool target=FirstTrait::method
208- let _b2 = <S as FirstTrait >:: method ( & s) ; // $ type=_b2:bool target=FirstTrait::method
209-
210- let _n1 = SecondTrait :: method ( & s) ; // $ type=_n1:i64 target=SecondTrait::method
211- let _n2 = <S as SecondTrait >:: method ( & s) ; // $ type=_n2:i64 target=SecondTrait::method
212- }
213- }
214-
215187mod method_non_parametric_impl {
216188 #[ derive( Debug ) ]
217189 struct MyThing < A > {
@@ -484,158 +456,7 @@ mod method_non_parametric_trait_impl {
484456 }
485457}
486458
487- mod impl_overlap {
488- #[ derive( Debug , Clone , Copy ) ]
489- struct S1 ;
490-
491- trait OverlappingTrait {
492- fn common_method ( self ) -> S1 ;
493-
494- fn common_method_2 ( self , s1 : S1 ) -> S1 ;
495- }
496-
497- impl OverlappingTrait for S1 {
498- // <S1_as_OverlappingTrait>::common_method
499- fn common_method ( self ) -> S1 {
500- S1
501- }
502-
503- // <S1_as_OverlappingTrait>::common_method_2
504- fn common_method_2 ( self , s1 : S1 ) -> S1 {
505- S1
506- }
507- }
508-
509- impl S1 {
510- // S1::common_method
511- fn common_method ( self ) -> S1 {
512- self
513- }
514-
515- // S1::common_method_2
516- fn common_method_2 ( self ) -> S1 {
517- self
518- }
519- }
520-
521- struct S2 < T2 > ( T2 ) ;
522-
523- impl S2 < i32 > {
524- // S2<i32>::common_method
525- fn common_method ( self ) -> S1 {
526- S1
527- }
528-
529- // S2<i32>::common_method
530- fn common_method_2 ( self ) -> S1 {
531- S1
532- }
533- }
534-
535- impl OverlappingTrait for S2 < i32 > {
536- // <S2<i32>_as_OverlappingTrait>::common_method
537- fn common_method ( self ) -> S1 {
538- S1
539- }
540-
541- // <S2<i32>_as_OverlappingTrait>::common_method_2
542- fn common_method_2 ( self , s1 : S1 ) -> S1 {
543- S1
544- }
545- }
546-
547- impl OverlappingTrait for S2 < S1 > {
548- // <S2<S1>_as_OverlappingTrait>::common_method
549- fn common_method ( self ) -> S1 {
550- S1
551- }
552-
553- // <S2<S1>_as_OverlappingTrait>::common_method_2
554- fn common_method_2 ( self , s1 : S1 ) -> S1 {
555- S1
556- }
557- }
558-
559- #[ derive( Debug ) ]
560- struct S3 < T3 > ( T3 ) ;
561-
562- trait OverlappingTrait2 < T > {
563- fn m ( & self , x : & T ) -> & Self ;
564- }
565-
566- impl < T > OverlappingTrait2 < T > for S3 < T > {
567- // <S3<T>_as_OverlappingTrait2<T>>::m
568- fn m ( & self , x : & T ) -> & Self {
569- self
570- }
571- }
572-
573- impl < T > S3 < T > {
574- // S3<T>::m
575- fn m ( & self , x : T ) -> & Self {
576- self
577- }
578- }
579-
580- trait MyTrait1 {
581- // MyTrait1::m
582- fn m ( & self ) { }
583- }
584-
585- trait MyTrait2 : MyTrait1 { }
586-
587- #[ derive( Debug ) ]
588- struct S4 ;
589-
590- impl MyTrait1 for S4 {
591- // <S4_as_MyTrait1>::m
592- fn m ( & self ) { }
593- }
594-
595- impl MyTrait2 for S4 { }
596-
597- #[ derive( Debug ) ]
598- struct S5 < T5 > ( T5 ) ;
599-
600- impl MyTrait1 for S5 < i32 > {
601- // <S5<i32>_as_MyTrait1>::m
602- fn m ( & self ) { }
603- }
604-
605- impl MyTrait2 for S5 < i32 > { }
606-
607- impl MyTrait1 for S5 < bool > { }
608-
609- impl MyTrait2 for S5 < bool > { }
610-
611- pub fn f ( ) {
612- let x = S1 ;
613- println ! ( "{:?}" , x. common_method( ) ) ; // $ target=S1::common_method
614- println ! ( "{:?}" , S1 :: common_method( x) ) ; // $ target=S1::common_method
615- println ! ( "{:?}" , x. common_method_2( ) ) ; // $ target=S1::common_method_2
616- println ! ( "{:?}" , S1 :: common_method_2( x) ) ; // $ target=S1::common_method_2
617-
618- let y = S2 ( S1 ) ;
619- println ! ( "{:?}" , y. common_method( ) ) ; // $ target=<S2<S1>_as_OverlappingTrait>::common_method
620- println ! ( "{:?}" , S2 :: <S1 >:: common_method( S2 ( S1 ) ) ) ; // $ target=<S2<S1>_as_OverlappingTrait>::common_method
621-
622- let z = S2 ( 0 ) ;
623- println ! ( "{:?}" , z. common_method( ) ) ; // $ target=S2<i32>::common_method
624- println ! ( "{:?}" , S2 :: common_method( S2 ( 0 ) ) ) ; // $ target=S2<i32>::common_method
625- println ! ( "{:?}" , S2 :: <i32 >:: common_method( S2 ( 0 ) ) ) ; // $ target=S2<i32>::common_method
626-
627- let w = S3 ( S1 ) ;
628- println ! ( "{:?}" , w. m( x) ) ; // $ target=S3<T>::m
629- println ! ( "{:?}" , S3 :: m( & w, x) ) ; // $ target=S3<T>::m
630-
631- S4 . m ( ) ; // $ target=<S4_as_MyTrait1>::m
632- S4 :: m ( & S4 ) ; // $ target=<S4_as_MyTrait1>::m
633- S5 ( 0i32 ) . m ( ) ; // $ target=<S5<i32>_as_MyTrait1>::m
634- S5 :: m ( & S5 ( 0i32 ) ) ; // $ target=<S5<i32>_as_MyTrait1>::m
635- S5 ( true ) . m ( ) ; // $ target=MyTrait1::m
636- S5 :: m ( & S5 ( true ) ) ; // $ target=MyTrait1::m
637- }
638- }
459+ mod overloading;
639460
640461mod type_parameter_bounds {
641462 use std:: fmt:: Debug ;
0 commit comments