dtolnay / rustversion

Conditional compilation according to rustc compiler version
Apache License 2.0
334 stars 15 forks source link

Avoid dead code warnings #19

Closed dtolnay closed 4 years ago

dtolnay commented 4 years ago

The previous implementation was emitting unused code warnings on non-nightly compilers.

warning: unused import: `crate::date::Date`
   --> src/lib.rs:158:5
    |
158 | use crate::date::Date;
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

warning: variant is never constructed: `Nightly`
  --> src/version.rs:14:5
   |
14 |     Nightly(Date),
   |     ^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default