From 9f71bac3c8e432618042bde52b85786008744b67 Mon Sep 17 00:00:00 2001 From: Shadaj Laddad Date: Thu, 24 Jul 2025 14:59:19 -0700 Subject: [PATCH 1/2] Ignore --diagnostic-width argument when computing hash --- src/compiler/rust.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compiler/rust.rs b/src/compiler/rust.rs index 79344de5e..1d9ea4ad1 100644 --- a/src/compiler/rust.rs +++ b/src/compiler/rust.rs @@ -1034,6 +1034,7 @@ counted_array!(static ARGS: [ArgInfo; _] = [ take_arg!("--crate-name", String, CanBeSeparated('='), CrateName), take_arg!("--crate-type", ArgCrateTypes, CanBeSeparated('='), CrateType), take_arg!("--deny", OsString, CanBeSeparated('='), PassThrough), + take_arg!("--diagnostic-width", OsString, CanBeSeparated('='), PassThrough), take_arg!("--emit", String, CanBeSeparated('='), Emit), take_arg!("--error-format", OsString, CanBeSeparated('='), PassThrough), take_arg!("--explain", OsString, CanBeSeparated('='), NotCompilation), @@ -1452,11 +1453,16 @@ where let (mut sortables, rest): (Vec<_>, Vec<_>) = os_string_arguments .iter() // We exclude a few arguments from the hash: - // -L, --extern, --out-dir + // -L, --extern, --out-dir, --diagnostic-width // These contain paths which aren't relevant to the output, and the compiler inputs // in those paths (rlibs and static libs used in the compilation) are used as hash // inputs below. - .filter(|&(arg, _)| !(arg == "--extern" || arg == "-L" || arg == "--out-dir")) + .filter(|&(arg, _)| { + !(arg == "--extern" + || arg == "-L" + || arg == "--out-dir" + || arg == "--diagnostic-width") + }) // We also exclude `--target` if it specifies a path to a .json file. The file content // is used as hash input below. // If `--target` specifies a string, it continues to be hashed as part of the arguments. From 7ae50e26c297e19b9edb2f56a8eb469546c573d1 Mon Sep 17 00:00:00 2001 From: Shadaj Laddad Date: Wed, 24 Sep 2025 18:30:20 -0700 Subject: [PATCH 2/2] Add --diagnostic-width to test for args ignored in hash --- src/compiler/rust.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/rust.rs b/src/compiler/rust.rs index 1d9ea4ad1..7fcf73ec9 100644 --- a/src/compiler/rust.rs +++ b/src/compiler/rust.rs @@ -3722,6 +3722,7 @@ proc_macro false "foo.rs", "--out-dir", "out", + "--diagnostic-width=1", "--extern", "a=1", "--crate-name",