Skip to content

Commit aeb3061

Browse files
committed
Update two failing incremental tests for the new behavior
On the nopt builders, we disable optimization by default for all tests which causes the new behavior to take effect and causes the tests to fail when they should not. By passing the `-O` flag explicitly, we will always run these tests with optimizations enabled.
1 parent 3186267 commit aeb3061

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/test/incremental/hygiene/load_cached_hygiene.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions:rpass1 rpass2
2-
// compile-flags: -Z query-dep-graph
2+
// compile-flags: -Z query-dep-graph -O
33
// aux-build:cached_hygiene.rs
44

55
// This tests the folllowing scenario
@@ -19,7 +19,12 @@
1919
// the metadata. Specifically, we were not resetting `orig_id`
2020
// for an `EpxnData` generate in the current crate, which would cause
2121
// us to serialize the `ExpnId` pointing to a garbage location in
22-
// the metadata.
22+
// the metadata.o
23+
24+
// NOTE: We're explicitly passing the `-O` optimization flag because if optimizations are not
25+
// enabled, then rustc will ignore the `#[inline(always)]` attribute which means we do not load
26+
// the optimized mir for the unmodified function to be loaded and so the CGU containing that
27+
// function will be reused.
2328

2429
#![feature(rustc_attrs)]
2530

src/test/incremental/remapped_paths_cc/main.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
// revisions:rpass1 rpass2 rpass3
2-
// compile-flags: -Z query-dep-graph -g
2+
// compile-flags: -Z query-dep-graph -g -O
33
// aux-build:extern_crate.rs
44

55
// ignore-asmjs wasm2js does not support source maps yet
6+
67
// This test case makes sure that we detect if paths emitted into debuginfo
78
// are changed, even when the change happens in an external crate.
89

10+
// NOTE: We're explicitly passing the `-O` optimization flag because if no optimizations are
11+
// requested, rustc will ignore the `#[inline]` attribute. This is a performance optimization for
12+
// non-optimized builds which causes us to generate fewer copies of inlined functions when
13+
// runtime performance doesn't matter. Without this flag, the function will go into a different
14+
// CGU which can be reused by this crate.
15+
916
#![feature(rustc_attrs)]
1017

1118
#![rustc_partition_reused(module="main", cfg="rpass2")]

0 commit comments

Comments
 (0)