Skip to content

The span of function is never used seem wrong #35974

Closed
@pmarcelll

Description

@pmarcelll

Sample code:

fn foo() { println!("foo"); }

fn bar() {
    println!("bar");
}

fn main() {

}

Output:

warning: function is never used: `foo`, #[warn(dead_code)] on by default
 --> <anon>:1:1
  |
1 | fn foo() { println!("foo"); }
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: function is never used: `bar`, #[warn(dead_code)] on by default
 --> <anon>:3:1
  |
3 | fn bar() {
  | ^

If the function is only one row, the whole function can be highlighted, but if the funcion consists of multiple lines, only the first character (the f from fn) is highlighted.

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