about summary refs log tree commit diff
path: root/src/test/incremental/change_pub_inherent_method_sig
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2017-10-27 18:57:15 +0200
committerMichael Woerister <michaelwoerister@posteo>2017-11-07 08:54:38 +0100
commitcedae73c8c1f474d979dbc368fc6848bff335f84 (patch)
tree51da3779b20ed5310ea5c30e043e0a9cdd8e960d /src/test/incremental/change_pub_inherent_method_sig
parent6a3659427e9cdf7a03789cd8aded2e09d171d32a (diff)
downloadrust-cedae73c8c1f474d979dbc368fc6848bff335f84.tar.gz
rust-cedae73c8c1f474d979dbc368fc6848bff335f84.zip
Fix incremental tests after change to instantiation strategy.
Diffstat (limited to 'src/test/incremental/change_pub_inherent_method_sig')
-rw-r--r--src/test/incremental/change_pub_inherent_method_sig/struct_point.rs45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs b/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs
index 4d12b7b390c..f2485a876cc 100644
--- a/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs
+++ b/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs
@@ -10,30 +10,32 @@
 
 // Test where we change the *signature* of a public, inherent method.
 
-// revisions:rpass1 rpass2
+// revisions:cfail1 cfail2
 // compile-flags: -Z query-dep-graph
+// must-compile-successfully
 
+#![crate_type = "rlib"]
 #![feature(rustc_attrs)]
 #![feature(stmt_expr_attributes)]
 #![allow(dead_code)]
 
 // These are expected to require translation.
-#![rustc_partition_translated(module="struct_point-point", cfg="rpass2")]
-#![rustc_partition_translated(module="struct_point-fn_calls_changed_method", cfg="rpass2")]
+#![rustc_partition_translated(module="struct_point-point", cfg="cfail2")]
+#![rustc_partition_translated(module="struct_point-fn_calls_changed_method", cfg="cfail2")]
 
-#![rustc_partition_reused(module="struct_point-fn_calls_another_method", 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")]
+#![rustc_partition_reused(module="struct_point-fn_calls_another_method", cfg="cfail2")]
+#![rustc_partition_reused(module="struct_point-fn_make_struct", cfg="cfail2")]
+#![rustc_partition_reused(module="struct_point-fn_read_field", cfg="cfail2")]
+#![rustc_partition_reused(module="struct_point-fn_write_field", cfg="cfail2")]
 
-mod point {
+pub mod point {
     pub struct Point {
         pub x: f32,
         pub y: f32,
     }
 
     impl Point {
-        #[cfg(rpass1)]
+        #[cfg(cfail1)]
         pub fn distance_from_point(&self, p: Option<Point>) -> f32 {
             let p = p.unwrap_or(Point { x: 0.0, y: 0.0 });
             let x_diff = self.x - p.x;
@@ -41,7 +43,7 @@ mod point {
             return x_diff * x_diff + y_diff * y_diff;
         }
 
-        #[cfg(rpass2)]
+        #[cfg(cfail2)]
         pub fn distance_from_point(&self, p: Option<&Point>) -> f32 {
             const ORIGIN: &Point = &Point { x: 0.0, y: 0.0 };
             let p = p.unwrap_or(ORIGIN);
@@ -57,10 +59,10 @@ mod point {
 }
 
 /// A fn item that calls the method that was changed
-mod fn_calls_changed_method {
+pub mod fn_calls_changed_method {
     use point::Point;
 
-    #[rustc_dirty(label="TypeckTables", cfg="rpass2")]
+    #[rustc_dirty(label="TypeckTables", cfg="cfail2")]
     pub fn check() {
         let p = Point { x: 2.0, y: 2.0 };
         p.distance_from_point(None);
@@ -68,10 +70,10 @@ mod fn_calls_changed_method {
 }
 
 /// A fn item that calls a method that was not changed
-mod fn_calls_another_method {
+pub mod fn_calls_another_method {
     use point::Point;
 
-    #[rustc_clean(label="TypeckTables", cfg="rpass2")]
+    #[rustc_clean(label="TypeckTables", cfg="cfail2")]
     pub fn check() {
         let p = Point { x: 2.0, y: 2.0 };
         p.x();
@@ -79,34 +81,31 @@ mod fn_calls_another_method {
 }
 
 /// A fn item that makes an instance of `Point` but does not invoke methods
-mod fn_make_struct {
+pub mod fn_make_struct {
     use point::Point;
 
-    #[rustc_clean(label="TypeckTables", cfg="rpass2")]
+    #[rustc_clean(label="TypeckTables", cfg="cfail2")]
     pub fn make_origin() -> Point {
         Point { x: 2.0, y: 2.0 }
     }
 }
 
 /// A fn item that reads fields from `Point` but does not invoke methods
-mod fn_read_field {
+pub mod fn_read_field {
     use point::Point;
 
-    #[rustc_clean(label="TypeckTables", cfg="rpass2")]
+    #[rustc_clean(label="TypeckTables", cfg="cfail2")]
     pub fn get_x(p: Point) -> f32 {
         p.x
     }
 }
 
 /// A fn item that writes to a field of `Point` but does not invoke methods
-mod fn_write_field {
+pub mod fn_write_field {
     use point::Point;
 
-    #[rustc_clean(label="TypeckTables", cfg="rpass2")]
+    #[rustc_clean(label="TypeckTables", cfg="cfail2")]
     pub fn inc_x(p: &mut Point) {
         p.x += 1.0;
     }
 }
-
-fn main() {
-}