Skip to content

Commit 93996b1

Browse files
committed
Fix dependency graph test cases to have correct commments and use -Z incr-comp
1 parent 876de6e commit 93996b1

6 files changed

+22
-6
lines changed

src/test/compile-fail/dep-graph-caller-callee.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that two unrelated functions have no trans dependency.
11+
// Test that immediate callers have to change when callee changes, but
12+
// not callers' callers.
13+
14+
// compile-flags: -Z incr-comp
1215

1316
#![feature(rustc_attrs)]
1417
#![allow(dead_code)]

src/test/compile-fail/dep-graph-struct-signature.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that two unrelated functions have no trans dependency.
11+
// Test cases where a changing struct appears in the signature of fns
12+
// and methods.
13+
14+
// compile-flags: -Z incr-comp
1215

1316
#![feature(rustc_attrs)]
1417
#![allow(dead_code)]
@@ -68,7 +71,7 @@ mod signatures {
6871

6972
#[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
7073
#[rustc_then_this_would_need(CollectItem)] //~ ERROR OK
71-
fn indirect(x: WillChange) { }
74+
fn indirect(x: WillChanges) { }
7275
}
7376

7477
// these are invalid dependencies, though sometimes we create edges

src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that two unrelated functions have no trans dependency.
11+
// Test that adding an impl to a trait `Foo` DOES affect functions
12+
// that only use `Bar` if they have methods in common.
13+
14+
// compile-flags: -Z incr-comp
1215

1316
#![feature(rustc_attrs)]
1417
#![allow(dead_code)]

src/test/compile-fail/dep-graph-trait-impl-two-traits.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// Test that adding an impl to a trait `Foo` does not affect functions
12-
// that only use `Bar`.
12+
// that only use `Bar`, so long as they do not have methods in common.
13+
14+
// compile-flags: -Z incr-comp
1315

1416
#![feature(rustc_attrs)]
1517
#![allow(warnings)]

src/test/compile-fail/dep-graph-trait-impl.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// Test that two unrelated functions have no trans dependency.
11+
// Test that when a trait impl changes, fns whose body uses that trait
12+
// must also be recompiled.
13+
14+
// compile-flags: -Z incr-comp
1215

1316
#![feature(rustc_attrs)]
1417
#![allow(warnings)]

src/test/compile-fail/dep-graph-unrelated.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// Test that two unrelated functions have no trans dependency.
1212

13+
// compile-flags: -Z incr-comp
14+
1315
#![feature(rustc_attrs)]
1416
#![allow(dead_code)]
1517

0 commit comments

Comments
 (0)