Skip to content

Commit

Permalink
Support incremental in compiletest for non-incremental modes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Sep 23, 2021
1 parent 0132f82 commit 2da6e66
Show file tree
Hide file tree
Showing 38 changed files with 166 additions and 119 deletions.
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/extern-drop-glue.rs
@@ -1,9 +1,10 @@
//

// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// We specify opt-level=0 because `drop_in_place` is `Internal` when optimizing
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/extern-drop-glue
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Zinline-in-all-cgus -Copt-level=0

#![allow(dead_code)]
Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/extern-generic.rs
@@ -1,7 +1,8 @@
//
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=eager -Cincremental=tmp/partitioning-tests/extern-generic -Zshare-generics=y
// incremental
// compile-flags:-Zprint-mono-items=eager -Zshare-generics=y

#![allow(dead_code)]
#![crate_type="lib"]
Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/incremental-merging.rs
@@ -1,6 +1,7 @@
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/incremental-merging
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Ccodegen-units=3

#![crate_type = "rlib"]
Expand Down
@@ -1,7 +1,8 @@
//
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/inlining-from-extern-crate
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Zinline-in-all-cgus

#![crate_type="lib"]
Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/local-drop-glue.rs
@@ -1,8 +1,9 @@
//
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// We specify opt-level=0 because `drop_in_place` is `Internal` when optimizing
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/local-drop-glue
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Zinline-in-all-cgus -Copt-level=0

#![allow(dead_code)]
Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/local-generic.rs
@@ -1,6 +1,7 @@
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=eager -Cincremental=tmp/partitioning-tests/local-generic
// incremental
// compile-flags:-Zprint-mono-items=eager

#![allow(dead_code)]
#![crate_type="lib"]
Expand Down
@@ -1,7 +1,8 @@
//
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/local-inlining-but-not-all
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Zinline-in-all-cgus=no

#![allow(dead_code)]
Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/local-inlining.rs
@@ -1,7 +1,8 @@
//
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/local-inlining
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Zinline-in-all-cgus

#![allow(dead_code)]
Expand Down
@@ -1,7 +1,8 @@
//
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/local-transitive-inlining
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Zinline-in-all-cgus

#![allow(dead_code)]
Expand Down
Expand Up @@ -4,9 +4,10 @@
// ignore-test

//
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/methods-are-with-self-type
// incremental
// compile-flags:-Zprint-mono-items=lazy

#![allow(dead_code)]
#![feature(start)]
Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/regular-modules.rs
@@ -1,6 +1,7 @@
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=eager -Cincremental=tmp/partitioning-tests/regular-modules
// incremental
// compile-flags:-Zprint-mono-items=eager

#![allow(dead_code)]
#![crate_type="lib"]
Expand Down
3 changes: 2 additions & 1 deletion src/test/codegen-units/partitioning/shared-generics.rs
Expand Up @@ -2,7 +2,8 @@
// no-prefer-dynamic
// NOTE: We always compile this test with -Copt-level=0 because higher opt-levels
// prevent drop-glue from participating in share-generics.
// compile-flags:-Zprint-mono-items=eager -Zshare-generics=yes -Cincremental=tmp/partitioning-tests/shared-generics-exe -Copt-level=0
// incremental
// compile-flags:-Zprint-mono-items=eager -Zshare-generics=yes -Copt-level=0

#![crate_type="rlib"]

Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/statics.rs
@@ -1,6 +1,7 @@
// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/statics
// incremental
// compile-flags:-Zprint-mono-items=lazy

#![crate_type="rlib"]

Expand Down
5 changes: 3 additions & 2 deletions src/test/codegen-units/partitioning/vtable-through-const.rs
@@ -1,8 +1,9 @@
//

// We specify -C incremental here because we want to test the partitioning for
// We specify incremental here because we want to test the partitioning for
// incremental compilation
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/vtable-through-const
// incremental
// compile-flags:-Zprint-mono-items=lazy
// compile-flags:-Zinline-in-all-cgus

// This test case makes sure, that references made through constants are
Expand Down
@@ -1,5 +1,5 @@
// check-pass
// compile-flags:-Cincremental=tmp/traits-assoc-type-macros
// incremental

// This test case makes sure that we can compile with incremental compilation
// enabled when there are macros, traits, inheritance and associated types involved.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/async-await/issue-72442.rs
@@ -1,5 +1,5 @@
// edition:2018
// compile-flags:-Cincremental=tmp/issue-72442
// incremental

use std::fs::File;
use std::future::Future;
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/async-await/issues/issue-64964.rs
@@ -1,5 +1,6 @@
// check-pass
// compile-flags: -Z query-dep-graph -C incremental=tmp/issue-64964
// incremental
// compile-flags: -Z query-dep-graph
// edition:2018

// Regression test for ICE related to `await`ing in a method + incr. comp. (#64964)
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs
@@ -1,7 +1,8 @@
// Test that when a trait impl changes, fns whose body uses that trait
// must also be recompiled.

// compile-flags: -Z query-dep-graph -C incremental=tmp/dep-graph-assoc-type-codegen
// incremental
// compile-flags: -Z query-dep-graph

#![feature(rustc_attrs)]
#![allow(warnings)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr
@@ -1,5 +1,5 @@
error: OK
--> $DIR/dep-graph-assoc-type-codegen.rs:28:5
--> $DIR/dep-graph-assoc-type-codegen.rs:29:5
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/dep-graph/dep-graph-caller-callee.rs
@@ -1,7 +1,8 @@
// Test that immediate callers have to change when callee changes, but
// not callers' callers.

// compile-flags: -Z query-dep-graph -C incremental=tmp/dep-graph-caller-callee
// incremental
// compile-flags: -Z query-dep-graph

#![feature(rustc_attrs)]
#![allow(dead_code)]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/dep-graph/dep-graph-caller-callee.stderr
@@ -1,11 +1,11 @@
error: OK
--> $DIR/dep-graph-caller-callee.rs:20:5
--> $DIR/dep-graph-caller-callee.rs:21:5
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `x` to `typeck`
--> $DIR/dep-graph-caller-callee.rs:31:5
--> $DIR/dep-graph-caller-callee.rs:32:5
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/dep-graph/dep-graph-struct-signature.rs
@@ -1,7 +1,8 @@
// Test cases where a changing struct appears in the signature of fns
// and methods.

// compile-flags: -Z query-dep-graph -C incremental=tmp/dep-graph-struct-signature
// incremental
// compile-flags: -Z query-dep-graph

#![feature(rustc_attrs)]
#![allow(dead_code)]
Expand Down
44 changes: 22 additions & 22 deletions src/test/ui/dep-graph/dep-graph-struct-signature.stderr
@@ -1,131 +1,131 @@
error: no path from `WillChange` to `type_of`
--> $DIR/dep-graph-struct-signature.rs:27:5
--> $DIR/dep-graph-struct-signature.rs:28:5
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `associated_item`
--> $DIR/dep-graph-struct-signature.rs:28:5
--> $DIR/dep-graph-struct-signature.rs:29:5
|
LL | #[rustc_then_this_would_need(associated_item)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `trait_def`
--> $DIR/dep-graph-struct-signature.rs:29:5
--> $DIR/dep-graph-struct-signature.rs:30:5
|
LL | #[rustc_then_this_would_need(trait_def)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:31:9
--> $DIR/dep-graph-struct-signature.rs:32:9
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:35:5
--> $DIR/dep-graph-struct-signature.rs:36:5
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:36:5
--> $DIR/dep-graph-struct-signature.rs:37:5
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:39:5
--> $DIR/dep-graph-struct-signature.rs:40:5
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:40:5
--> $DIR/dep-graph-struct-signature.rs:41:5
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:45:5
--> $DIR/dep-graph-struct-signature.rs:46:5
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:47:9
--> $DIR/dep-graph-struct-signature.rs:48:9
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:48:9
--> $DIR/dep-graph-struct-signature.rs:49:9
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:52:5
--> $DIR/dep-graph-struct-signature.rs:53:5
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:54:9
--> $DIR/dep-graph-struct-signature.rs:55:9
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:55:9
--> $DIR/dep-graph-struct-signature.rs:56:9
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:60:9
--> $DIR/dep-graph-struct-signature.rs:61:9
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: OK
--> $DIR/dep-graph-struct-signature.rs:62:9
--> $DIR/dep-graph-struct-signature.rs:63:9
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `type_of`
--> $DIR/dep-graph-struct-signature.rs:67:5
--> $DIR/dep-graph-struct-signature.rs:68:5
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `type_of`
--> $DIR/dep-graph-struct-signature.rs:74:5
--> $DIR/dep-graph-struct-signature.rs:75:5
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `fn_sig`
--> $DIR/dep-graph-struct-signature.rs:76:9
--> $DIR/dep-graph-struct-signature.rs:77:9
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `fn_sig`
--> $DIR/dep-graph-struct-signature.rs:80:5
--> $DIR/dep-graph-struct-signature.rs:81:5
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `fn_sig`
--> $DIR/dep-graph-struct-signature.rs:83:5
--> $DIR/dep-graph-struct-signature.rs:84:5
|
LL | #[rustc_then_this_would_need(fn_sig)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: no path from `WillChange` to `typeck`
--> $DIR/dep-graph-struct-signature.rs:84:5
--> $DIR/dep-graph-struct-signature.rs:85:5
|
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
@@ -1,7 +1,8 @@
// Test that adding an impl to a trait `Foo` DOES affect functions
// that only use `Bar` if they have methods in common.

// compile-flags: -Z query-dep-graph -C incremental=tmp/dep-graph-trait-impl-two-traits-same-method
// incremental
// compile-flags: -Z query-dep-graph

#![feature(rustc_attrs)]
#![allow(dead_code)]
Expand Down

0 comments on commit 2da6e66

Please sign in to comment.