Skip to content

Commit

Permalink
fixup test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Nov 28, 2016
1 parent dac987e commit 72fbf9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct Point {
fn unused_helper() {
}

fn distance_squared(this: &Point) -> f32 {
pub fn distance_squared(this: &Point) -> f32 {
return this.x * this.x + this.y * this.y;
}

Expand All @@ -26,10 +26,3 @@ impl Point {
distance_squared(self).sqrt()
}
}

impl Point {
pub fn translate(&mut self, x: f32, y: f32) {
self.x += x;
self.y += y;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
#![allow(dead_code)]

#![rustc_partition_reused(module="struct_point-fn_calls_methods_in_same_impl", cfg="rpass2")]
#![rustc_partition_reused(module="struct_point-fn_calls_methods_in_another_impl", cfg="rpass2")]
#![rustc_partition_reused(module="struct_point-fn_calls_free_fn", cfg="rpass2")]
#![rustc_partition_reused(module="struct_point-fn_read_field", cfg="rpass2")]
#![rustc_partition_reused(module="struct_point-fn_write_field", cfg="rpass2")]
#![rustc_partition_reused(module="struct_point-fn_make_struct", cfg="rpass2")]

extern crate point;

/// A fn item that calls (public) methods on `Point` from the same impl which changed
/// A fn item that calls (public) methods on `Point` from the same impl
mod fn_calls_methods_in_same_impl {
use point::Point;

Expand All @@ -40,13 +40,13 @@ mod fn_calls_methods_in_same_impl {
}

/// A fn item that calls (public) methods on `Point` from another impl
mod fn_calls_methods_in_another_impl {
use point::Point;
mod fn_calls_free_fn {
use point::{self, Point};

#[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
pub fn check() {
let mut x = Point { x: 2.0, y: 2.0 };
x.translate(3.0, 3.0);
let x = Point { x: 2.0, y: 2.0 };
point::distance_squared(&x);
}
}

Expand Down

0 comments on commit 72fbf9f

Please sign in to comment.