diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 4 |
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); |
