mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-26 22:05:14 +00:00
Merge pull request #687 from oli-obk/fix_glob_enum_use
fix enum glob use (again)
This commit is contained in:
commit
eabc54406e
@ -44,9 +44,11 @@ impl EnumGlobUse {
|
||||
if let ItemUse(ref item_use) = item.node {
|
||||
if let ViewPath_::ViewPathGlob(_) = item_use.node {
|
||||
let def = cx.tcx.def_map.borrow()[&item.id];
|
||||
if let Some(NodeItem(it)) = cx.tcx.map.get_if_local(def.def_id()) {
|
||||
if let ItemEnum(..) = it.node {
|
||||
span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants");
|
||||
if let Some(node_id) = cx.tcx.map.as_local_node_id(def.def_id()) {
|
||||
if let Some(NodeItem(it)) = cx.tcx.map.find(node_id) {
|
||||
if let ItemEnum(..) = it.node {
|
||||
span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let Some(dp) = cx.sess().cstore.def_path(def.def_id()).last() {
|
||||
|
@ -17,4 +17,8 @@ mod blurg {
|
||||
pub use std::cmp::Ordering::*; // ok, re-export
|
||||
}
|
||||
|
||||
mod tests {
|
||||
use super::*;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
Reference in New Issue
Block a user