diff --git a/config.example.toml b/config.example.toml index b155e4731b0..77efdb6d392 100644 --- a/config.example.toml +++ b/config.example.toml @@ -420,7 +420,7 @@ #jobs = 0 # What custom diff tool to use for displaying compiletest tests. -#display-diff-tool = "difft --color=always --background=light --display=side-by-side" +#compiletest-diff-tool = "difft --color=always --background=light --display=side-by-side" # ============================================================================= # General install configuration options diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index c6c40b0f7f7..f671b0dcfe6 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1834,8 +1834,8 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the if builder.config.cmd.only_modified() { cmd.arg("--only-modified"); } - if let Some(display_diff_tool) = &builder.config.display_diff_tool { - cmd.arg("--display-diff-tool").arg(display_diff_tool); + if let Some(compiletest_diff_tool) = &builder.config.compiletest_diff_tool { + cmd.arg("--compiletest-diff-tool").arg(compiletest_diff_tool); } let mut flags = if is_rustdoc { Vec::new() } else { vec!["-Crpath".to_string()] }; diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index ba2ec8181f9..ec3a0a6de84 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -369,8 +369,8 @@ pub struct Config { /// `paths=["foo", "bar"]`. pub paths: Vec, - /// What custom diff tool to use for displaying compiletest tests. - pub display_diff_tool: Option, + /// Command for visual diff display, e.g. `diff-tool --color=always`. + pub compiletest_diff_tool: Option, } #[derive(Clone, Debug, Default)] @@ -895,7 +895,7 @@ define_config! { android_ndk: Option = "android-ndk", optimized_compiler_builtins: Option = "optimized-compiler-builtins", jobs: Option = "jobs", - display_diff_tool: Option = "display-diff-tool", + compiletest_diff_tool: Option = "compiletest-diff-tool", } } @@ -1516,7 +1516,7 @@ impl Config { android_ndk, optimized_compiler_builtins, jobs, - display_diff_tool, + compiletest_diff_tool, } = toml.build.unwrap_or_default(); config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0)))); @@ -2163,7 +2163,7 @@ impl Config { config.rust_debuginfo_level_tests = debuginfo_level_tests.unwrap_or(DebuginfoLevel::None); config.optimized_compiler_builtins = optimized_compiler_builtins.unwrap_or(config.channel != "dev"); - config.display_diff_tool = display_diff_tool; + config.compiletest_diff_tool = compiletest_diff_tool; let download_rustc = config.download_rustc_commit.is_some(); // See https://github.com/rust-lang/compiler-team/issues/326 diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 5e50e227ded..5070f016d3c 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -388,6 +388,7 @@ pub struct Config { /// Used by the "needs-profiler-runtime" directive in test files. pub profiler_runtime: bool, + /// Command for visual diff display, e.g. `diff-tool --color=always`. pub diff_command: Option, } diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index a008410e34b..0f514db42bf 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -178,7 +178,7 @@ pub fn parse_config(args: Vec) -> Config { ) .optopt( "", - "display-diff-tool", + "compiletest-diff-tool", "What custom diff tool to use for displaying compiletest tests.", "COMMAND", ); @@ -370,7 +370,7 @@ pub fn parse_config(args: Vec) -> Config { git_merge_commit_email: matches.opt_str("git-merge-commit-email").unwrap(), profiler_runtime: matches.opt_present("profiler-runtime"), - diff_command: matches.opt_str("display-diff-tool"), + diff_command: matches.opt_str("compiletest-diff-tool"), } }