Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 30, 2019
1 parent 0128844 commit 4558068
Show file tree
Hide file tree
Showing 53 changed files with 295 additions and 295 deletions.
4 changes: 2 additions & 2 deletions src/librustc_incremental/persist/dirty_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
//! we will compare the fingerprint from the current and from the previous
//! compilation session as appropriate:
//!
//! - `#[rustc_clean(cfg="rev2", except="TypeckTables")]` if we are
//! - `#[rustc_clean(cfg="rev2", except="typeck_tables_of")]` if we are
//! in `#[cfg(rev2)]`, then the fingerprints associated with
//! `DepNode::TypeckTables(X)` must be DIFFERENT (`X` is the `DefId` of the
//! `DepNode::typeck_tables_of(X)` must be DIFFERENT (`X` is the `DefId` of the
//! current node).
//! - `#[rustc_clean(cfg="rev2")]` same as above, except that the
//! fingerprints must be the SAME (along with all other fingerprints).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern crate point;
pub mod fn_calls_methods_in_same_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let x = Point { x: 2.0, y: 2.0 };
x.distance_from_origin();
Expand All @@ -35,7 +35,7 @@ pub mod fn_calls_methods_in_same_impl {
pub mod fn_calls_free_fn {
use point::{self, Point};

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let x = Point { x: 2.0, y: 2.0 };
point::distance_squared(&x);
Expand All @@ -46,7 +46,7 @@ pub mod fn_calls_free_fn {
pub mod fn_make_struct {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn make_origin() -> Point {
Point { x: 2.0, y: 2.0 }
}
Expand All @@ -56,7 +56,7 @@ pub mod fn_make_struct {
pub mod fn_read_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn get_x(p: Point) -> f32 {
p.x
}
Expand All @@ -66,7 +66,7 @@ pub mod fn_read_field {
pub mod fn_write_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn inc_x(p: &mut Point) {
p.x += 1.0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/incremental/callee_caller_cross_crate/b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

extern crate a;

#[rustc_dirty(label="TypeckTables", cfg="rpass2")]
#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")]
pub fn call_function0() {
a::function0(77);
}

#[rustc_clean(label="TypeckTables", cfg="rpass2")]
#[rustc_clean(label="typeck_tables_of", cfg="rpass2")]
pub fn call_function1() {
a::function1(77);
}
Expand Down
14 changes: 7 additions & 7 deletions src/test/incremental/change_add_field/struct_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub mod point {
pub mod fn_with_type_in_sig {
use point::Point;

#[rustc_dirty(label="TypeckTables", cfg="cfail2")]
#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")]
pub fn boop(p: Option<&Point>) -> f32 {
p.map(|p| p.total()).unwrap_or(0.0)
}
Expand All @@ -86,7 +86,7 @@ pub mod fn_with_type_in_sig {
pub mod call_fn_with_type_in_sig {
use fn_with_type_in_sig;

#[rustc_dirty(label="TypeckTables", cfg="cfail2")]
#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")]
pub fn bip() -> f32 {
fn_with_type_in_sig::boop(None)
}
Expand All @@ -102,7 +102,7 @@ pub mod call_fn_with_type_in_sig {
pub mod fn_with_type_in_body {
use point::Point;

#[rustc_dirty(label="TypeckTables", cfg="cfail2")]
#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")]
pub fn boop() -> f32 {
Point::origin().total()
}
Expand All @@ -115,7 +115,7 @@ pub mod fn_with_type_in_body {
pub mod call_fn_with_type_in_body {
use fn_with_type_in_body;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn bip() -> f32 {
fn_with_type_in_body::boop()
}
Expand All @@ -125,7 +125,7 @@ pub mod call_fn_with_type_in_body {
pub mod fn_make_struct {
use point::Point;

#[rustc_dirty(label="TypeckTables", cfg="cfail2")]
#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")]
pub fn make_origin(p: Point) -> Point {
Point { ..p }
}
Expand All @@ -135,7 +135,7 @@ pub mod fn_make_struct {
pub mod fn_read_field {
use point::Point;

#[rustc_dirty(label="TypeckTables", cfg="cfail2")]
#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")]
pub fn get_x(p: Point) -> f32 {
p.x
}
Expand All @@ -145,7 +145,7 @@ pub mod fn_read_field {
pub mod fn_write_field {
use point::Point;

#[rustc_dirty(label="TypeckTables", cfg="cfail2")]
#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")]
pub fn inc_x(p: &mut Point) {
p.x += 1.0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/incremental/change_crate_order/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern crate a;
use a::A;
use b::B;

//? #[rustc_clean(label="TypeckTables", cfg="rpass2")]
//? #[rustc_clean(label="typeck_tables_of", cfg="rpass2")]
pub fn main() {
A + B;
}
10 changes: 5 additions & 5 deletions src/test/incremental/change_private_fn/struct_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub mod point {
pub mod fn_calls_methods_in_same_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let x = Point { x: 2.0, y: 2.0 };
x.distance_from_origin();
Expand All @@ -62,7 +62,7 @@ pub mod fn_calls_methods_in_same_impl {
pub mod fn_calls_methods_in_another_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let mut x = Point { x: 2.0, y: 2.0 };
x.translate(3.0, 3.0);
Expand All @@ -73,7 +73,7 @@ pub mod fn_calls_methods_in_another_impl {
pub mod fn_make_struct {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn make_origin() -> Point {
Point { x: 2.0, y: 2.0 }
}
Expand All @@ -83,7 +83,7 @@ pub mod fn_make_struct {
pub mod fn_read_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn get_x(p: Point) -> f32 {
p.x
}
Expand All @@ -93,7 +93,7 @@ pub mod fn_read_field {
pub mod fn_write_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn inc_x(p: &mut Point) {
p.x += 1.0;
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/incremental/change_private_fn_cc/struct_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern crate point;
pub mod fn_calls_methods_in_same_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let x = Point { x: 2.0, y: 2.0 };
x.distance_from_origin();
Expand All @@ -34,7 +34,7 @@ pub mod fn_calls_methods_in_same_impl {
pub mod fn_calls_methods_in_another_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let mut x = Point { x: 2.0, y: 2.0 };
x.translate(3.0, 3.0);
Expand All @@ -45,7 +45,7 @@ pub mod fn_calls_methods_in_another_impl {
pub mod fn_make_struct {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn make_origin() -> Point {
Point { x: 2.0, y: 2.0 }
}
Expand All @@ -55,7 +55,7 @@ pub mod fn_make_struct {
pub mod fn_read_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn get_x(p: Point) -> f32 {
p.x
}
Expand All @@ -65,7 +65,7 @@ pub mod fn_read_field {
pub mod fn_write_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn inc_x(p: &mut Point) {
p.x += 1.0;
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/incremental/change_private_impl_method/struct_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub mod point {
pub mod fn_calls_methods_in_same_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let x = Point { x: 2.0, y: 2.0 };
x.distance_from_origin();
Expand All @@ -62,7 +62,7 @@ pub mod fn_calls_methods_in_same_impl {
pub mod fn_calls_methods_in_another_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let mut x = Point { x: 2.0, y: 2.0 };
x.translate(3.0, 3.0);
Expand All @@ -73,7 +73,7 @@ pub mod fn_calls_methods_in_another_impl {
pub mod fn_make_struct {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn make_origin() -> Point {
Point { x: 2.0, y: 2.0 }
}
Expand All @@ -83,7 +83,7 @@ pub mod fn_make_struct {
pub mod fn_read_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn get_x(p: Point) -> f32 {
p.x
}
Expand All @@ -93,7 +93,7 @@ pub mod fn_read_field {
pub mod fn_write_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn inc_x(p: &mut Point) {
p.x += 1.0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern crate point;
pub mod fn_calls_methods_in_same_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let x = Point { x: 2.0, y: 2.0 };
x.distance_from_origin();
Expand All @@ -35,7 +35,7 @@ pub mod fn_calls_methods_in_same_impl {
pub mod fn_calls_methods_in_another_impl {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn dirty() {
let mut x = Point { x: 2.0, y: 2.0 };
x.translate(3.0, 3.0);
Expand All @@ -46,7 +46,7 @@ pub mod fn_calls_methods_in_another_impl {
pub mod fn_make_struct {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn make_origin() -> Point {
Point { x: 2.0, y: 2.0 }
}
Expand All @@ -56,7 +56,7 @@ pub mod fn_make_struct {
pub mod fn_read_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn get_x(p: Point) -> f32 {
p.x
}
Expand All @@ -66,7 +66,7 @@ pub mod fn_read_field {
pub mod fn_write_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn inc_x(p: &mut Point) {
p.x += 1.0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub mod point {
pub mod fn_calls_changed_method {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let p = Point { x: 2.0, y: 2.0 };
p.distance_from_origin();
Expand All @@ -53,7 +53,7 @@ pub mod fn_calls_changed_method {
pub mod fn_calls_another_method {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn check() {
let p = Point { x: 2.0, y: 2.0 };
p.x();
Expand All @@ -64,7 +64,7 @@ pub mod fn_calls_another_method {
pub mod fn_make_struct {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn make_origin() -> Point {
Point { x: 2.0, y: 2.0 }
}
Expand All @@ -74,7 +74,7 @@ pub mod fn_make_struct {
pub mod fn_read_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn get_x(p: Point) -> f32 {
p.x
}
Expand All @@ -84,7 +84,7 @@ pub mod fn_read_field {
pub mod fn_write_field {
use point::Point;

#[rustc_clean(label="TypeckTables", cfg="cfail2")]
#[rustc_clean(label="typeck_tables_of", cfg="cfail2")]
pub fn inc_x(p: &mut Point) {
p.x += 1.0;
}
Expand Down
Loading

0 comments on commit 4558068

Please sign in to comment.