Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Z terminal-width should account for compiler-generated text, not just user-supplied text #95432

Open
shepmaster opened this issue Mar 29, 2022 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics

Comments

@shepmaster
Copy link
Member

With source code with a long line (64 columns) but that is less than the chosen width (80 columns):

fn main() {
    a_very_long_function_name_that_pushes(and_then_an_argument);
}

fn a_very_long_function_name_that_pushes<T>(_: T) {}

The error message produced by rustc exceeds (90 columns) the width:

% rustc +nightly long.rs -Z terminal-width=80
error[E0425]: cannot find value `and_then_an_argument` in this scope
 --> long.rs:2:43
  |
2 |     a_very_long_function_name_that_pushes(and_then_an_argument);
  |                                           ^^^^^^^^^^^^^^^^^^^^ not found in this scope

/cc #84673

@shepmaster shepmaster added A-diagnostics Area: Messages for errors, warnings, and lints WG-diagnostics Working group: Diagnostics labels Mar 29, 2022
@ehuss
Copy link
Contributor

ehuss commented Jun 28, 2022

I think it would be nice if the diagnostic system could world-wrap text in general. For example:

image

could be rendered something like:

error: incremental compilation: could not create session directory lock file:
       Operation not supported (os error 45)
  |
  = note: the filesystem for the incremental path at
          /Volumes/home/Temp/a/target/debug/incremental/a-2ayqbks3yzri8/s-gb4y1p66hp-to8nz4-working
          does not appear to support locking, consider changing the
          incremental path to a filesystem that supports locking or disable
          incremental compilation
  = help: incremental compilation can be disabled by setting the environment
          variable CARGO_INCREMENTAL=0 (see
          https://doc.rust-lang.org/cargo/reference/profiles.html#incremental)
  = help: the entire build directory can be changed to a different filesystem
          by setting the environment variable CARGO_TARGET_DIR to a different
          path (see
          https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir)

@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics
Projects
None yet
Development

No branches or pull requests

3 participants