Fix macro_use_import
ICE
This commit is contained in:
parent
86fb0e8266
commit
c05760ff90
@ -114,6 +114,7 @@ impl<'tcx> LateLintPass<'tcx> for MacroUseImports {
|
||||
.iter()
|
||||
.find(|attr| attr.ident().map(|s| s.to_string()) == Some("macro_use".to_string()));
|
||||
if let Res::Def(DefKind::Mod, id) = path.res;
|
||||
if !id.is_local();
|
||||
then {
|
||||
for kid in cx.tcx.item_children(id).iter() {
|
||||
if let Res::Def(DefKind::Macro(_mac_type), mac_id) = kid.res {
|
||||
|
@ -4,7 +4,7 @@
|
||||
// run-rustfix
|
||||
// ignore-32bit
|
||||
|
||||
#![allow(unused_imports, unreachable_code, unused_variables, dead_code)]
|
||||
#![allow(unused_imports, unreachable_code, unused_variables, dead_code, unused_attributes)]
|
||||
#![allow(clippy::single_component_path_imports)]
|
||||
#![warn(clippy::macro_use_imports)]
|
||||
|
||||
@ -40,4 +40,8 @@ mod a {
|
||||
}
|
||||
}
|
||||
|
||||
// issue #7015, ICE due to calling `item_children` with local `DefId`
|
||||
#[macro_use]
|
||||
use a as b;
|
||||
|
||||
fn main() {}
|
||||
|
@ -4,7 +4,7 @@
|
||||
// run-rustfix
|
||||
// ignore-32bit
|
||||
|
||||
#![allow(unused_imports, unreachable_code, unused_variables, dead_code)]
|
||||
#![allow(unused_imports, unreachable_code, unused_variables, dead_code, unused_attributes)]
|
||||
#![allow(clippy::single_component_path_imports)]
|
||||
#![warn(clippy::macro_use_imports)]
|
||||
|
||||
@ -40,4 +40,8 @@ mod a {
|
||||
}
|
||||
}
|
||||
|
||||
// issue #7015, ICE due to calling `item_children` with local `DefId`
|
||||
#[macro_use]
|
||||
use a as b;
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user