diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs
index ed2c6d9bc56..fd7236fabd7 100644
--- a/src/cargo/core/compiler/mod.rs
+++ b/src/cargo/core/compiler/mod.rs
@@ -899,22 +899,8 @@ fn add_error_format_and_color(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder) {
cmd.arg(json);
let config = cx.bcx.config;
- if config.nightly_features_allowed {
- match (
- config.cli_unstable().terminal_width,
- config.shell().err_width().diagnostic_terminal_width(),
- ) {
- // Terminal width explicitly provided - only useful for testing.
- (Some(Some(width)), _) => {
- cmd.arg(format!("--diagnostic-width={}", width));
- }
- // Terminal width was not explicitly provided but flag was provided - common case.
- (Some(None), Some(width)) => {
- cmd.arg(format!("--diagnostic-width={}", width));
- }
- // User didn't opt-in.
- _ => (),
- }
+ if let Some(width) = config.shell().err_width().diagnostic_terminal_width() {
+ cmd.arg(format!("--diagnostic-width={width}"));
}
}
diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs
index f295f063be1..28abfea49ba 100644
--- a/src/cargo/core/features.rs
+++ b/src/cargo/core/features.rs
@@ -686,7 +686,6 @@ unstable_cli_options!(
target_applies_to_host: bool = ("Enable the `target-applies-to-host` key in the .cargo/config.toml file"),
rustdoc_map: bool = ("Allow passing external documentation mappings to rustdoc"),
separate_nightlies: bool = (HIDDEN),
- terminal_width: Option