withoutboats / fehler

Rust doesn't have exceptions
Other
629 stars 24 forks source link

Missing dead_code warnings #48

Open dtolnay opened 4 years ago

dtolnay commented 4 years ago
use anyhow::Error;
use fehler::throws;

#[throws]
fn f() {}

fn g() {}

fn main() {}
warning: function is never used: `g`
 --> src/main.rs:7:4
  |
7 | fn g() {}
  |    ^
  |
  = note: `#[warn(dead_code)]` on by default

It seems throws functions aren't seen by the compiler as dead code when they should be. Probably some Span is wrong somewhere.

(Tested as of master @ df2e3d43aafc3966f0789d678975ebf2011bb10b.)