Skip to content

Commit

Permalink
Track verbose and verbose_internals
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jyn514 committed Jan 19, 2024
1 parent aac51d5 commit cbf71f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fn assert_same_hash(x: &Options, y: &Options) {
assert_same_clone(y);
}

#[track_caller]
fn assert_different_hash(x: &Options, y: &Options) {
assert_ne!(x.dep_tracking_hash(true), y.dep_tracking_hash(true));
assert_ne!(x.dep_tracking_hash(false), y.dep_tracking_hash(false));
Expand Down Expand Up @@ -713,7 +714,6 @@ fn test_unstable_options_tracking_hash() {
untracked!(unpretty, Some("expanded".to_string()));
untracked!(unstable_options, true);
untracked!(validate_mir, true);
untracked!(verbose_internals, true);
untracked!(write_long_types_to_disk, false);
// tidy-alphabetical-end

Expand Down Expand Up @@ -845,6 +845,7 @@ fn test_unstable_options_tracking_hash() {
};
}
tracked_no_crate_hash!(no_codegen, true);
tracked_no_crate_hash!(verbose_internals, true);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ top_level_options!(
working_dir: RealFileName [TRACKED],
color: ColorConfig [UNTRACKED],

verbose: bool [UNTRACKED],
verbose: bool [TRACKED_NO_CRATE_HASH],
}
);

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

0 comments on commit cbf71f7

Please sign in to comment.