File tree 2 files changed +7
-14
lines changed
src/test/incremental/add_private_fn_at_krate_root_cc
2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub struct Point {
17
17
fn unused_helper ( ) {
18
18
}
19
19
20
- fn distance_squared ( this : & Point ) -> f32 {
20
+ pub fn distance_squared ( this : & Point ) -> f32 {
21
21
return this. x * this. x + this. y * this. y ;
22
22
}
23
23
@@ -26,10 +26,3 @@ impl Point {
26
26
distance_squared ( self ) . sqrt ( )
27
27
}
28
28
}
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 21
21
#![ allow( dead_code) ]
22
22
23
23
#![ 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" ) ]
25
25
#![ rustc_partition_reused( module="struct_point-fn_read_field" , cfg="rpass2" ) ]
26
26
#![ rustc_partition_reused( module="struct_point-fn_write_field" , cfg="rpass2" ) ]
27
27
#![ rustc_partition_reused( module="struct_point-fn_make_struct" , cfg="rpass2" ) ]
28
28
29
29
extern crate point;
30
30
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
32
32
mod fn_calls_methods_in_same_impl {
33
33
use point:: Point ;
34
34
@@ -40,13 +40,13 @@ mod fn_calls_methods_in_same_impl {
40
40
}
41
41
42
42
/// 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 } ;
45
45
46
46
#[ rustc_clean( label="TypeckItemBody" , cfg="rpass2" ) ]
47
47
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 ) ;
50
50
}
51
51
}
52
52
You can’t perform that action at this time.
0 commit comments