rustc should "ellipsis" very long lines when printing warnings

Created on 26 Jul 2019  路  1Comment  路  Source: rust-lang/rust

STR on macOS:

  • Clone https://github.com/RustAudio/coreaudio-sys
  • Checkout commit 13a32d718647b9e5be1defdef8197958cfda31fa
  • Edit Cargo.toml to update the bindgen dependency from 0.42 to 0.49.
  • cargo build
  • Admire the 200MB of warnings scrolling in your terminal for ~800 actual lines of output.

The longest line is 1.4MB. On a 80-columns terminal that's > 17K lines of terminal output just for that one line.

There are two kinds of warnings, one reasonably-sized, because they're on short #[link] attribute lines, and one where each corresponding line of source is one of those crazy long, bindgen-generated, ones.

They look like:

warning: `extern` block uses type `u128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
 --> /tmp/coreaudio-sys/target/x86_64-apple-darwin/debug/build/coreaudio-sys-0d8fd082e359c2ec/out/coreaudio.rs:9:210358
  |
9 | ..... 1.4MB line
  | .... 210K whitespaces ^^^^
  |
  = note: #[warn(improper_ctypes)] on by default

So what each warning is really doing is pointing at 4 characters inside the 1.4MB line. All warnings are about the same line, by the way. All are for different offsets.

A-diagnostics T-compiler

Most helpful comment

Work in progress in #63402:

Screen Shot 2019-08-08 at 11 17 09 PM

>All comments

Work in progress in #63402:

Screen Shot 2019-08-08 at 11 17 09 PM

Was this page helpful?
0 / 5 - 0 ratings