Skip to content

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

Open
@shepmaster

Description

@shepmaster

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions