1 // Test where we change the body of a private method in an impl.
2 // We then test what sort of functions must be rebuilt as a result.
4 // revisions:cfail1 cfail2
5 // compile-flags: -Z query-dep-graph
7 // build-pass (FIXME(62277): could be check-pass?)
9 #![crate_type = "rlib"]
10 #![feature(rustc_attrs)]
11 #![feature(stmt_expr_attributes)]
14 #![rustc_partition_reused(module="struct_point-fn_calls_methods_in_same_impl", cfg="cfail2")]
15 #![rustc_partition_reused(module="struct_point-fn_calls_methods_in_another_impl", cfg="cfail2")]
16 #![rustc_partition_reused(module="struct_point-fn_read_field", cfg="cfail2")]
17 #![rustc_partition_reused(module="struct_point-fn_write_field", cfg="cfail2")]
18 #![rustc_partition_reused(module="struct_point-fn_make_struct", cfg="cfail2")]
22 /// A fn item that calls (public) methods on `Point` from the same impl which changed
23 pub mod fn_calls_methods_in_same_impl {
26 #[rustc_clean(cfg="cfail2")]
28 let x = Point { x: 2.0, y: 2.0 };
29 x.distance_from_origin();
33 /// A fn item that calls (public) methods on `Point` from another impl
34 pub mod fn_calls_methods_in_another_impl {
37 #[rustc_clean(cfg="cfail2")]
39 let mut x = Point { x: 2.0, y: 2.0 };
40 x.translate(3.0, 3.0);
44 /// A fn item that makes an instance of `Point` but does not invoke methods
45 pub mod fn_make_struct {
48 #[rustc_clean(cfg="cfail2")]
49 pub fn make_origin() -> Point {
50 Point { x: 2.0, y: 2.0 }
54 /// A fn item that reads fields from `Point` but does not invoke methods
55 pub mod fn_read_field {
58 #[rustc_clean(cfg="cfail2")]
59 pub fn get_x(p: Point) -> f32 {
64 /// A fn item that writes to a field of `Point` but does not invoke methods
65 pub mod fn_write_field {
68 #[rustc_clean(cfg="cfail2")]
69 pub fn inc_x(p: &mut Point) {