Skip to content

The span of function is never used seem wrong #35974

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
pmarcelll opened this issue Aug 24, 2016 · 1 comment
Closed

The span of function is never used seem wrong #35974

pmarcelll opened this issue Aug 24, 2016 · 1 comment

Comments

@pmarcelll
Copy link
Contributor

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.

@nagisa
Copy link
Member

nagisa commented Aug 24, 2016

Duplicate of #33961

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