diff options
| author | Jeremy Fitzhardinge <jsgf@fb.com> | 2021-07-14 16:39:17 -0700 |
|---|---|---|
| committer | Jeremy Fitzhardinge <jsgf@fb.com> | 2021-07-14 17:04:55 -0700 |
| commit | 51142a0f5fd55d864c068759a7f0e00ab64f6e37 (patch) | |
| tree | 9d442d57405aa3ecc73fa686b2518276a31d99c9 /compiler/rustc_interface | |
| parent | e87188c252a3b6dea8ed54d7915fbc2cfb61443b (diff) | |
| download | rust-51142a0f5fd55d864c068759a7f0e00ab64f6e37.tar.gz rust-51142a0f5fd55d864c068759a7f0e00ab64f6e37.zip | |
Make --cap-lints and related options leave crate hash alone
Closes: #87144
Diffstat (limited to 'compiler/rustc_interface')
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index a053253ec16..7e9a2c1312a 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -236,9 +236,9 @@ fn test_lints_tracking_hash_different_values() { (String::from("d"), Level::Deny), ]; - assert_different_hash(&v1, &v2); - assert_different_hash(&v1, &v3); - assert_different_hash(&v2, &v3); + assert_non_crate_hash_different(&v1, &v2); + assert_non_crate_hash_different(&v1, &v3); + assert_non_crate_hash_different(&v2, &v3); } #[test] @@ -261,7 +261,21 @@ fn test_lints_tracking_hash_different_construction_order() { ]; // The hash should be order-dependent - assert_different_hash(&v1, &v2); + assert_non_crate_hash_different(&v1, &v2); +} + +#[test] +fn test_lint_cap_hash_different() { + let mut v1 = Options::default(); + let mut v2 = Options::default(); + let v3 = Options::default(); + + v1.lint_cap = Some(Level::Forbid); + v2.lint_cap = Some(Level::Allow); + + assert_non_crate_hash_different(&v1, &v2); + assert_non_crate_hash_different(&v1, &v3); + assert_non_crate_hash_different(&v2, &v3); } #[test] |
