diff --git a/clippy_lints/src/enum_glob_use.rs b/clippy_lints/src/enum_glob_use.rs index c00cdc07f84..8a0d03d2ae9 100644 --- a/clippy_lints/src/enum_glob_use.rs +++ b/clippy_lints/src/enum_glob_use.rs @@ -1,6 +1,7 @@ //! lint on `use`ing all variants of an enum use rustc::hir::*; +use rustc::hir::def::Def; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use syntax::ast::NodeId; use syntax::codemap::Span; @@ -12,8 +13,7 @@ use utils::span_lint; /// an enumeration variant, rather than importing variants. /// /// **Known problems:** Old-style enumerations that prefix the variants are -/// still around. May cause problems with modules that are not snake_case (see -/// [#2397](https://github.com/rust-lang-nursery/rust-clippy/issues/2397)) +/// still around. /// /// **Example:** /// ```rust @@ -48,16 +48,13 @@ impl EnumGlobUse { return; // re-exports are fine } if let ItemUse(ref path, UseKind::Glob) = item.node { - // FIXME: ask jseyfried why the qpath.def for `use std::cmp::Ordering::*;` - // extracted through `ItemUse(ref qpath, UseKind::Glob)` is a `Mod` and not an - // `Enum` - // if let Def::Enum(_) = path.def { - if path.segments - .last() - .and_then(|seg| seg.name.as_str().chars().next()) - .map_or(false, char::is_uppercase) - { - span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants"); + if let Def::Enum(_) = path.def { + span_lint( + cx, + ENUM_GLOB_USE, + item.span, + "don't use glob imports for enum variants", + ); } } } diff --git a/tests/ui/enum_glob_use.rs b/tests/ui/enum_glob_use.rs index 76d0d29bb53..efb37fbe49d 100644 --- a/tests/ui/enum_glob_use.rs +++ b/tests/ui/enum_glob_use.rs @@ -23,4 +23,10 @@ mod tests { use super::*; } +#[allow(non_snake_case)] +mod CamelCaseName { +} + +use CamelCaseName::*; + fn main() {}