Skip to content

Commit c1b9bbf

Browse files
Rollup merge of #87145 - jsgf:fix-lint-opt-hash, r=michaelwoerister
Make --cap-lints and related options leave crate hash alone Closes: #87144
2 parents 36de877 + 51142a0 commit c1b9bbf

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

compiler/rustc_interface/src/tests.rs

+18-4
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ fn test_lints_tracking_hash_different_values() {
236236
(String::from("d"), Level::Deny),
237237
];
238238

239-
assert_different_hash(&v1, &v2);
240-
assert_different_hash(&v1, &v3);
241-
assert_different_hash(&v2, &v3);
239+
assert_non_crate_hash_different(&v1, &v2);
240+
assert_non_crate_hash_different(&v1, &v3);
241+
assert_non_crate_hash_different(&v2, &v3);
242242
}
243243

244244
#[test]
@@ -261,7 +261,21 @@ fn test_lints_tracking_hash_different_construction_order() {
261261
];
262262

263263
// The hash should be order-dependent
264-
assert_different_hash(&v1, &v2);
264+
assert_non_crate_hash_different(&v1, &v2);
265+
}
266+
267+
#[test]
268+
fn test_lint_cap_hash_different() {
269+
let mut v1 = Options::default();
270+
let mut v2 = Options::default();
271+
let v3 = Options::default();
272+
273+
v1.lint_cap = Some(Level::Forbid);
274+
v2.lint_cap = Some(Level::Allow);
275+
276+
assert_non_crate_hash_different(&v1, &v2);
277+
assert_non_crate_hash_different(&v1, &v3);
278+
assert_non_crate_hash_different(&v2, &v3);
265279
}
266280

267281
#[test]

compiler/rustc_session/src/options.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ top_level_options!(
133133
/// can influence whether overflow checks are done or not.
134134
debug_assertions: bool [TRACKED],
135135
debuginfo: DebugInfo [TRACKED],
136-
lint_opts: Vec<(String, lint::Level)> [TRACKED],
137-
lint_cap: Option<lint::Level> [TRACKED],
138-
force_warns: Vec<String> [TRACKED],
136+
lint_opts: Vec<(String, lint::Level)> [TRACKED_NO_CRATE_HASH],
137+
lint_cap: Option<lint::Level> [TRACKED_NO_CRATE_HASH],
138+
force_warns: Vec<String> [TRACKED_NO_CRATE_HASH],
139139
describe_lints: bool [UNTRACKED],
140140
output_types: OutputTypes [TRACKED],
141141
search_paths: Vec<SearchPath> [UNTRACKED],

0 commit comments

Comments
 (0)