]> git.proxmox.com Git - rustc.git/blob - src/test/incremental/change_private_fn_cc/auxiliary/point.rs
Update unsuspicious file list
[rustc.git] / src / test / incremental / change_private_fn_cc / auxiliary / point.rs
1 pub struct Point {
2 pub x: f32,
3 pub y: f32,
4 }
5
6 fn distance_squared(this: &Point) -> f32 {
7 #[cfg(cfail1)]
8 return this.x + this.y;
9
10 #[cfg(cfail2)]
11 return this.x * this.x + this.y * this.y;
12 }
13
14 impl Point {
15 pub fn distance_from_origin(&self) -> f32 {
16 distance_squared(self).sqrt()
17 }
18 }
19
20 impl Point {
21 pub fn translate(&mut self, x: f32, y: f32) {
22 self.x += x;
23 self.y += y;
24 }
25 }