Closed
Description
Currently, the spans for unused declarations, like enums and fns, span the whole declaration. Instead of spanning the whole declaration, we now put a single ^ at the beginning to say "it starts here".
But, if you compare unused enums/fns with unused variables an imports, it feels like one is pointing at the beginning and one is pointing at the name:
warning: enum is never used: `R0`, #[warn(dead_code)] on by default
--> src/main.rs:10:1
|>
10 |> enum R0 {
|> ^
warning: function is never used: `bob`, #[warn(dead_code)] on by default
--> src/main.rs:14:1
|>
14 |> fn bob() {
|> ^
warning: unused variable: `program`, #[warn(unused_variables)] on by default
--> src/main.rs:24:9
|>
24 |> let program = Add (box Read, box Neg(box Int(8)));
|> ^^^^^^^
warning: unused import, #[warn(unused_imports)] on by default
--> src/main.rs:19:9
|>
19 |> use R0::*;
|> ^^^^^^
Shouldn't we instead just underline the name in all cases (assuming there is one)?
Giving us:
warning: enum is never used: `R0`, #[warn(dead_code)] on by default
--> src/main.rs:10:1
|>
10 |> enum R0 {
|> ^^
warning: function is never used: `bob`, #[warn(dead_code)] on by default
--> src/main.rs:14:1
|>
14 |> fn bob() {
|> ^^^
warning: unused variable: `program`, #[warn(unused_variables)] on by default
--> src/main.rs:24:9
|>
24 |> let program = Add (box Read, box Neg(box Int(8)));
|> ^^^^^^^
warning: unused import, #[warn(unused_imports)] on by default
--> src/main.rs:19:9
|>
19 |> use R0::*;
|> ^^^^^^