mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Fix header
This commit is contained in:
@@ -102,7 +102,6 @@
|
||||
pub struct WildcardImports {
|
||||
warn_on_all: bool,
|
||||
test_modules_deep: u32,
|
||||
ignore: bool,
|
||||
}
|
||||
|
||||
impl WildcardImports {
|
||||
@@ -110,7 +109,6 @@ pub fn new(warn_on_all: bool) -> Self {
|
||||
Self {
|
||||
warn_on_all,
|
||||
test_modules_deep: 0,
|
||||
ignore: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,14 +116,8 @@ pub fn new(warn_on_all: bool) -> Self {
|
||||
impl_lint_pass!(WildcardImports => [ENUM_GLOB_USE, WILDCARD_IMPORTS]);
|
||||
|
||||
impl LateLintPass<'_> for WildcardImports {
|
||||
fn check_crate(&mut self, cx: &LateContext<'_>) {
|
||||
if cx.sess().opts.test {
|
||||
self.ignore = true;
|
||||
}
|
||||
}
|
||||
|
||||
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
|
||||
if self.ignore {
|
||||
if cx.sess().is_test_crate() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// compile-flags: --test
|
||||
//@compile-flags: --test
|
||||
|
||||
#![warn(clippy::wildcard_imports)]
|
||||
#![allow(unused, clippy::unnecessary_wraps, clippy::let_unit_value)]
|
||||
|
||||
Reference in New Issue
Block a user