about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorxFrednet <xFrednet@gmail.com>2022-05-20 20:37:38 +0200
committerxFrednet <xFrednet@gmail.com>2022-05-20 20:47:31 +0200
commit4e6cf0036e5e7afdc4fe86cccc99482ff4cf71bf (patch)
treec0de46a0482ccc460d4789e23b4d2abb5bf17787 /src
parent01421e0cbda66655e25d48c1c72c2dcbe77040c2 (diff)
parent6f26383f8ec8dfe89858876eac127161d148eb13 (diff)
downloadrust-4e6cf0036e5e7afdc4fe86cccc99482ff4cf71bf.tar.gz
rust-4e6cf0036e5e7afdc4fe86cccc99482ff4cf71bf.zip
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'src')
-rw-r--r--src/main.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 240e233420f..9ee4a40cbf2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -123,8 +123,12 @@ impl ClippyCmd {
             .map(|arg| format!("{}__CLIPPY_HACKERY__", arg))
             .collect();
 
+        // Currently, `CLIPPY_TERMINAL_WIDTH` is used only to format "unknown field" error messages.
+        let terminal_width = termize::dimensions().map_or(0, |(w, _)| w);
+
         cmd.env("RUSTC_WORKSPACE_WRAPPER", Self::path())
             .env("CLIPPY_ARGS", clippy_args)
+            .env("CLIPPY_TERMINAL_WIDTH", terminal_width.to_string())
             .arg(self.cargo_subcommand)
             .args(&self.args);