Skip to content

Commit 72fbf9f

Browse files
committed
fixup test cases
1 parent dac987e commit 72fbf9f

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/test/incremental/add_private_fn_at_krate_root_cc/auxiliary/point.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct Point {
1717
fn 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-
}

src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
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

2929
extern 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
3232
mod 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

0 commit comments

Comments
 (0)