Skip to content

Commit f4fad79

Browse files
committed
Auto merge of #10833 - ehuss:terminal-width-new-flag, r=Eh2406
Update terminal-width flag. The rustc flag `-Zterminal-width` has been stabilized as `--terminal-width` in rust-lang/rust#95635. This updates cargo to use the new flag so that tests will pass. Tests won't pass until the next nightly is published in about 10 hours from now. I just wanted to post this to get ahead of the breaking change. This doesn't stabilize in cargo because that will take more time, and this is needed to prevent CI from failing. Will continue the stabilization discussion at rust-lang/rust#84673.
2 parents 57a0f8c + 79d7dc0 commit f4fad79

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cargo/core/compiler/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,11 @@ fn add_error_format_and_color(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder) {
793793
) {
794794
// Terminal width explicitly provided - only useful for testing.
795795
(Some(Some(width)), _) => {
796-
cmd.arg(format!("-Zterminal-width={}", width));
796+
cmd.arg(format!("--diagnostic-width={}", width));
797797
}
798798
// Terminal width was not explicitly provided but flag was provided - common case.
799799
(Some(None), Some(width)) => {
800-
cmd.arg(format!("-Zterminal-width={}", width));
800+
cmd.arg(format!("--diagnostic-width={}", width));
801801
}
802802
// User didn't opt-in.
803803
_ => (),

tests/testsuite/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6107,7 +6107,7 @@ fn target_directory_backup_exclusion() {
61076107
#[cargo_test]
61086108
fn simple_terminal_width() {
61096109
if !is_nightly() {
6110-
// --terminal-width is unstable
6110+
// --diagnostic-width is stabilized in 1.64
61116111
return;
61126112
}
61136113
let p = project()

0 commit comments

Comments
 (0)