Skip to content

Commit 748af4f

Browse files
committed
Track verbose and verbose_internals
bjorn3 says: > On errors we don't finalize the incr comp cache, but non-fatal diagnostics are cached afaik. Otherwise we would have to replay the query in question, which we may not be able to do if the query key is not reconstructible from the dep node fingerprint. So we must track these flags to avoid replaying incorrect diagnostics.
1 parent aac51d5 commit 748af4f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

compiler/rustc_interface/src/tests.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ fn assert_same_hash(x: &Options, y: &Options) {
9898
assert_same_clone(y);
9999
}
100100

101+
#[track_caller]
101102
fn assert_different_hash(x: &Options, y: &Options) {
102103
assert_ne!(x.dep_tracking_hash(true), y.dep_tracking_hash(true));
103104
assert_ne!(x.dep_tracking_hash(false), y.dep_tracking_hash(false));
@@ -713,7 +714,6 @@ fn test_unstable_options_tracking_hash() {
713714
untracked!(unpretty, Some("expanded".to_string()));
714715
untracked!(unstable_options, true);
715716
untracked!(validate_mir, true);
716-
untracked!(verbose_internals, true);
717717
untracked!(write_long_types_to_disk, false);
718718
// tidy-alphabetical-end
719719

@@ -845,6 +845,7 @@ fn test_unstable_options_tracking_hash() {
845845
};
846846
}
847847
tracked_no_crate_hash!(no_codegen, true);
848+
tracked_no_crate_hash!(verbose_internals, true);
848849
}
849850

850851
#[test]

compiler/rustc_session/src/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ top_level_options!(
224224
working_dir: RealFileName [TRACKED],
225225
color: ColorConfig [UNTRACKED],
226226

227-
verbose: bool [UNTRACKED],
227+
verbose: bool [TRACKED_NO_CRATE_HASH],
228228
}
229229
);
230230

@@ -1986,7 +1986,7 @@ written to standard error output)"),
19861986
validate_mir: bool = (false, parse_bool, [UNTRACKED],
19871987
"validate MIR after each transformation"),
19881988
#[rustc_lint_opt_deny_field_access("use `Session::verbose_internals` instead of this field")]
1989-
verbose_internals: bool = (false, parse_bool, [UNTRACKED],
1989+
verbose_internals: bool = (false, parse_bool, [TRACKED_NO_CRATE_HASH],
19901990
"in general, enable more debug printouts (default: no)"),
19911991
#[rustc_lint_opt_deny_field_access("use `Session::verify_llvm_ir` instead of this field")]
19921992
verify_llvm_ir: bool = (false, parse_bool, [TRACKED],

tests/incremental/commandline-args.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
#![rustc_partition_codegened(module="commandline_args", cfg="rpass4")]
1212

1313
// Between revisions 1 and 2, we are changing the debuginfo-level, which should
14-
// invalidate the cache. Between revisions 2 and 3, we are adding `--verbose`
14+
// invalidate the cache. Between revisions 2 and 3, we are adding `--diagnostic-width`
1515
// which should have no effect on the cache. Between revisions, we are adding
1616
// `--remap-path-prefix` which should invalidate the cache:
1717
//[rpass1] compile-flags: -C debuginfo=0
1818
//[rpass2] compile-flags: -C debuginfo=2
19-
//[rpass3] compile-flags: -C debuginfo=2 --verbose
20-
//[rpass4] compile-flags: -C debuginfo=2 --verbose --remap-path-prefix=/home/bors/rust=src
19+
//[rpass3] compile-flags: -C debuginfo=2 --diagnostic-width=80
20+
//[rpass4] compile-flags: -C debuginfo=2 --diagnostic-width=80 --remap-path-prefix=/home/bors/r=src
2121

2222
pub fn main() {
2323
// empty

0 commit comments

Comments
 (0)