@@ -909,36 +909,36 @@ mod generic_enum {
909909}
910910
911911mod method_supertraits {
912- #[ derive( Debug ) ]
912+ #[ derive( Debug , Clone , Copy ) ]
913913 struct MyThing < A > {
914914 a : A ,
915915 }
916916
917- #[ derive( Debug ) ]
917+ #[ derive( Debug , Clone , Copy ) ]
918918 struct MyThing2 < A > {
919919 a : A ,
920920 }
921921
922- #[ derive( Debug ) ]
922+ #[ derive( Debug , Clone , Copy ) ]
923923 struct S1 ;
924- #[ derive( Debug ) ]
924+ #[ derive( Debug , Clone , Copy ) ]
925925 struct S2 ;
926926
927927 trait MyTrait1 < Tr1 > {
928928 // MyTrait1::m1
929929 fn m1 ( self ) -> Tr1 ;
930930 }
931931
932- trait MyTrait2 < Tr2 > : MyTrait1 < Tr2 > {
932+ trait MyTrait2 < Tr2 > : MyTrait1 < Tr2 > + Copy {
933933 #[ rustfmt:: skip]
934- fn m2 ( self ) -> Tr2
934+ fn m2 ( & self ) -> Tr2
935935 where
936936 Self : Sized ,
937937 {
938938 if 3 > 2 { // $ target=gt
939939 self . m1 ( ) // $ target=MyTrait1::m1
940940 } else {
941- Self :: m1 ( self ) // $ target=MyTrait1::m1
941+ Self :: m1 ( * self ) // $ target=deref target=MyTrait1::m1
942942 }
943943 }
944944 }
@@ -952,7 +952,7 @@ mod method_supertraits {
952952 if 3 > 2 { // $ target=gt
953953 self . m2 ( ) . a // $ target=m2 $ fieldof=MyThing
954954 } else {
955- Self :: m2 ( self ) . a // $ target=m2 fieldof=MyThing
955+ Self :: m2 ( & self ) . a // $ target=m2 fieldof=MyThing
956956 }
957957 }
958958 }
@@ -964,7 +964,7 @@ mod method_supertraits {
964964 }
965965 }
966966
967- impl < T > MyTrait2 < T > for MyThing < T > { }
967+ impl < T : Copy > MyTrait2 < T > for MyThing < T > { }
968968
969969 impl < T > MyTrait1 < MyThing < T > > for MyThing2 < T > {
970970 // MyThing2::m1
@@ -973,9 +973,9 @@ mod method_supertraits {
973973 }
974974 }
975975
976- impl < T > MyTrait2 < MyThing < T > > for MyThing2 < T > { }
976+ impl < T : Copy > MyTrait2 < MyThing < T > > for MyThing2 < T > { }
977977
978- impl < T > MyTrait3 < T > for MyThing2 < T > { }
978+ impl < T : Copy > MyTrait3 < T > for MyThing2 < T > { }
979979
980980 fn call_trait_m1 < T1 , T2 : MyTrait1 < T1 > > ( x : T2 ) -> T1 {
981981 x. m1 ( ) // $ target=MyTrait1::m1
@@ -2558,25 +2558,23 @@ pub mod exec {
25582558pub mod path_buf {
25592559 // a highly simplified model of `PathBuf::canonicalize`
25602560
2561- pub struct Path {
2562- }
2561+ pub struct Path { }
25632562
25642563 impl Path {
25652564 pub const fn new ( ) -> Path {
2566- Path { }
2565+ Path { }
25672566 }
25682567
25692568 pub fn canonicalize ( & self ) -> Result < PathBuf , ( ) > {
25702569 Ok ( PathBuf :: new ( ) ) // $ target=new
25712570 }
25722571 }
25732572
2574- pub struct PathBuf {
2575- }
2573+ pub struct PathBuf { }
25762574
25772575 impl PathBuf {
25782576 pub const fn new ( ) -> PathBuf {
2579- PathBuf { }
2577+ PathBuf { }
25802578 }
25812579 }
25822580
@@ -2587,7 +2585,7 @@ pub mod path_buf {
25872585 #[ inline]
25882586 fn deref ( & self ) -> & Path {
25892587 // (very much not a real implementation)
2590- static path : Path = Path :: new ( ) ; // $ target=new
2588+ static path: Path = Path :: new ( ) ; // $ target=new
25912589 & path
25922590 }
25932591 }
0 commit comments