File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
src/test/incremental/add_private_fn_at_krate_root_cc Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub struct Point {
1717fn unused_helper ( ) {
1818}
1919
20- fn distance_squared ( this : & Point ) -> f32 {
20+ pub fn distance_squared ( this : & Point ) -> f32 {
2121 return this. x * this. x + this. y * this. y ;
2222}
2323
@@ -26,10 +26,3 @@ impl Point {
2626 distance_squared ( self ) . sqrt ( )
2727 }
2828}
29-
30- impl Point {
31- pub fn translate ( & mut self , x : f32 , y : f32 ) {
32- self . x += x;
33- self . y += y;
34- }
35- }
Original file line number Diff line number Diff line change 2121#![ allow( dead_code) ]
2222
2323#![ rustc_partition_reused( module="struct_point-fn_calls_methods_in_same_impl" , cfg="rpass2" ) ]
24- #![ rustc_partition_reused( module="struct_point-fn_calls_methods_in_another_impl " , cfg="rpass2" ) ]
24+ #![ rustc_partition_reused( module="struct_point-fn_calls_free_fn " , cfg="rpass2" ) ]
2525#![ rustc_partition_reused( module="struct_point-fn_read_field" , cfg="rpass2" ) ]
2626#![ rustc_partition_reused( module="struct_point-fn_write_field" , cfg="rpass2" ) ]
2727#![ rustc_partition_reused( module="struct_point-fn_make_struct" , cfg="rpass2" ) ]
2828
2929extern crate point;
3030
31- /// A fn item that calls (public) methods on `Point` from the same impl which changed
31+ /// A fn item that calls (public) methods on `Point` from the same impl
3232mod fn_calls_methods_in_same_impl {
3333 use point:: Point ;
3434
@@ -40,13 +40,13 @@ mod fn_calls_methods_in_same_impl {
4040}
4141
4242/// A fn item that calls (public) methods on `Point` from another impl
43- mod fn_calls_methods_in_another_impl {
44- use point:: Point ;
43+ mod fn_calls_free_fn {
44+ use point:: { self , Point } ;
4545
4646 #[ rustc_clean( label="TypeckItemBody" , cfg="rpass2" ) ]
4747 pub fn check ( ) {
48- let mut x = Point { x : 2.0 , y : 2.0 } ;
49- x . translate ( 3.0 , 3.0 ) ;
48+ let x = Point { x : 2.0 , y : 2.0 } ;
49+ point :: distance_squared ( & x ) ;
5050 }
5151}
5252
You can’t perform that action at this time.
0 commit comments