Closed
Description
Below generates an unused warning:
extern crate num;
use num::Zero;
pub mod foo {
use super::*;
pub fn foo_zero() -> u64 {
u64::zero()
}
}
warning: unused import: `num::Zero`
--> src/lib.rs:3:5
|
3 | use num::Zero;
| ^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
While removing the suggested offended line generates error:
error: no associated item named `zero` found for type `u64` in the current scope
--> src/lib.rs:7:9
|
7 | u64::zero()
| ^^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope; the following traits are implemented but not in scope, perhaps add a `use` for one of them:
= help: candidate #1: `use core::fmt::num::Int;`
= help: candidate #2: `use num::Zero;`
Tested on rustc 1.18.0 (03fc9d622 2017-06-06)
and rustc 1.21.0-nightly (59ccba995 2017-08-17)
with slightly different error message.
Seems similar to symptom of #30159