Static rustc_lint::builtin::UNUSED_QUALIFICATIONS

source ·
pub static UNUSED_QUALIFICATIONS: &'static Lint
Expand description

The unused_qualifications lint detects unnecessarily qualified names.

§Example

#![deny(unused_qualifications)]
mod foo {
    pub fn bar() {}
}

fn main() {
    use foo::bar;
    foo::bar();
    bar();
}

{{produces}}

§Explanation

If an item from another module is already brought into scope, then there is no need to qualify it in this case. You can call bar() directly, without the foo::.

This lint is “allow” by default because it is somewhat pedantic, and doesn’t indicate an actual problem, but rather a stylistic choice, and can be noisy when refactoring or moving around code.