about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-11-11 18:22:41 -0500
committerNiko Matsakis <niko@alum.mit.edu>2016-11-17 13:44:21 -0500
commit34c361cfb2e7aa3efffe8783d2c31afc9e43f040 (patch)
treec58d14fb7887fd565ccc152d22d7f7e65a40c36b /src/test
parent629f5ffb23aeb96621bb4da7f7ea6d605670056b (diff)
downloadrust-34c361cfb2e7aa3efffe8783d2c31afc9e43f040.tar.gz
rust-34c361cfb2e7aa3efffe8783d2c31afc9e43f040.zip
when creating an AssociatedItem, read data from impl, not impl item
Before, when we created an AssociatedItem for impl item X, we would read
the impl item itself. Now we instead load up the impl I that contains X
and read the data from the `ImplItemRef` for X; actually, we do it for
all impl items in I pre-emptively.

This kills the last source of edges between a method X and a call to a
method Y defined in the same impl.

Fixes #37121
Diffstat (limited to 'src/test')
-rw-r--r--src/test/incremental/change_private_impl_method/struct_point.rs11
-rw-r--r--src/test/incremental/change_private_impl_method_cc/struct_point.rs26
2 files changed, 17 insertions, 20 deletions
diff --git a/src/test/incremental/change_private_impl_method/struct_point.rs b/src/test/incremental/change_private_impl_method/struct_point.rs
index 8fa34bde170..46e5a88eef9 100644
--- a/src/test/incremental/change_private_impl_method/struct_point.rs
+++ b/src/test/incremental/change_private_impl_method/struct_point.rs
@@ -20,9 +20,8 @@
 
 #![rustc_partition_translated(module="struct_point-point", cfg="rpass2")]
 
-// FIXME(#37121) -- the following two modules *should* be reused but are not
-#![rustc_partition_translated(module="struct_point-fn_calls_methods_in_same_impl", cfg="rpass2")]
-#![rustc_partition_translated(module="struct_point-fn_calls_methods_in_another_impl", cfg="rpass2")]
+#![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_make_struct", cfg="rpass2")]
 #![rustc_partition_reused(module="struct_point-fn_read_field", cfg="rpass2")]
 #![rustc_partition_reused(module="struct_point-fn_write_field", cfg="rpass2")]
@@ -60,8 +59,7 @@ mod point {
 mod fn_calls_methods_in_same_impl {
     use point::Point;
 
-    // FIXME(#37121) -- we should not need to typeck this again
-    #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
+    #[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
     pub fn check() {
         let x = Point { x: 2.0, y: 2.0 };
         x.distance_from_origin();
@@ -72,8 +70,7 @@ mod fn_calls_methods_in_same_impl {
 mod fn_calls_methods_in_another_impl {
     use point::Point;
 
-    // FIXME(#37121) -- we should not need to typeck this again
-    #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
+    #[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);
diff --git a/src/test/incremental/change_private_impl_method_cc/struct_point.rs b/src/test/incremental/change_private_impl_method_cc/struct_point.rs
index d8e5fbadad8..a8779e3f92d 100644
--- a/src/test/incremental/change_private_impl_method_cc/struct_point.rs
+++ b/src/test/incremental/change_private_impl_method_cc/struct_point.rs
@@ -19,12 +19,15 @@
 #![feature(stmt_expr_attributes)]
 #![allow(dead_code)]
 
-// FIXME(#37333) -- the following modules *should* be reused but are not
+#![rustc_partition_reused(module="struct_point-fn_read_field", cfg="rpass2")]
+#![rustc_partition_reused(module="struct_point-fn_write_field", cfg="rpass2")]
+
+// FIXME(#37333) the struct fields get entangled with inherent methods
+#![rustc_partition_translated(module="struct_point-fn_make_struct", cfg="rpass2")]
+
+// FIXME(#37720) these two should be reused, but data gets entangled across crates
 #![rustc_partition_translated(module="struct_point-fn_calls_methods_in_same_impl", cfg="rpass2")]
 #![rustc_partition_translated(module="struct_point-fn_calls_methods_in_another_impl", cfg="rpass2")]
-#![rustc_partition_translated(module="struct_point-fn_make_struct", cfg="rpass2")]
-#![rustc_partition_translated(module="struct_point-fn_read_field", cfg="rpass2")]
-#![rustc_partition_translated(module="struct_point-fn_write_field", cfg="rpass2")]
 
 extern crate point;
 
@@ -32,7 +35,7 @@ extern crate point;
 mod fn_calls_methods_in_same_impl {
     use point::Point;
 
-    // FIXME(#37333) -- we should not need to typeck this again
+    // FIXME(#37720) data gets entangled across crates
     #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
     pub fn check() {
         let x = Point { x: 2.0, y: 2.0 };
@@ -44,9 +47,9 @@ mod fn_calls_methods_in_same_impl {
 mod fn_calls_methods_in_another_impl {
     use point::Point;
 
-    // FIXME(#37333) -- we should not need to typeck this again
+    // FIXME(#37720) data gets entangled across crates
     #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
-    pub fn check() {
+    pub fn dirty() {
         let mut x = Point { x: 2.0, y: 2.0 };
         x.translate(3.0, 3.0);
     }
@@ -56,8 +59,7 @@ mod fn_calls_methods_in_another_impl {
 mod fn_make_struct {
     use point::Point;
 
-    // FIXME(#37333) -- we should not need to typeck this again
-    #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
+    #[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
     pub fn make_origin() -> Point {
         Point { x: 2.0, y: 2.0 }
     }
@@ -67,8 +69,7 @@ mod fn_make_struct {
 mod fn_read_field {
     use point::Point;
 
-    // FIXME(#37333) -- we should not need to typeck this again
-    #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
+    #[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
     pub fn get_x(p: Point) -> f32 {
         p.x
     }
@@ -78,8 +79,7 @@ mod fn_read_field {
 mod fn_write_field {
     use point::Point;
 
-    // FIXME(#37333) -- we should not need to typeck this again
-    #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
+    #[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
     pub fn inc_x(p: &mut Point) {
         p.x += 1.0;
     }