Skip to content

Warning message formatting: unused const #37355

Closed
@fabric-and-ink

Description

@fabric-and-ink

Hello!
I noticed the following behaviour: if I insert a line break into my const definition, the highlighting and "underlining" behaviour of the "unused" warning changes. It confused me for the first moment, since I thought I spelled const wrong.

warning: constant item is never used: `IND_TOP_RIGHT`, #[warn(dead_code)] on by default
   --> src/lib.rs:191:1
    |
191 | const IND_TOP_RIGHT: usize    =
    | ^

vs.

warning: constant item is never used: `IND_TOP_RIGHT`, #[warn(dead_code)] on by default
   --> src/lib.rs:191:1
    |
191 | const IND_TOP_RIGHT: usize    = 5;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Wouldn't it be better if only the constants name was highlighted anyway?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions