Skip to content

Warning message formatting: unused const #37355

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

Closed
fabric-and-ink opened this issue Oct 22, 2016 · 2 comments
Closed

Warning message formatting: unused const #37355

fabric-and-ink opened this issue Oct 22, 2016 · 2 comments

Comments

@fabric-and-ink
Copy link
Contributor

fabric-and-ink commented Oct 22, 2016

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?

@fabric-and-ink fabric-and-ink changed the title Warning message formatting: unused const var Warning message formatting: unused const Oct 22, 2016
@nagisa
Copy link
Member

nagisa commented Oct 22, 2016

Duplicate of #33961

@fabric-and-ink
Copy link
Contributor Author

Oh you are right. I couldn't find this issue before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants