diff options
| -rw-r--r-- | clippy_lints/src/macro_use.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/utils/internal_lints.rs | 4 | ||||
| -rw-r--r-- | clippy_utils/src/lib.rs | 2 | ||||
| -rw-r--r-- | tests/ui/macro_use_imports.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/macro_use_imports.rs | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/clippy_lints/src/macro_use.rs b/clippy_lints/src/macro_use.rs index 50d80e6a1d2..41f5a913b31 100644 --- a/clippy_lints/src/macro_use.rs +++ b/clippy_lints/src/macro_use.rs @@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for MacroUseImports { if let Res::Def(DefKind::Mod, id) = path.res; if !id.is_local(); then { - for kid in cx.tcx.item_children(id).iter() { + for kid in cx.tcx.module_children(id).iter() { if let Res::Def(DefKind::Macro(_mac_type), mac_id) = kid.res { let span = mac_attr.span; let def_path = cx.tcx.def_path_str(mac_id); diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index e98dcd3cf98..7d196af7a53 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -924,7 +924,7 @@ pub fn check_path(cx: &LateContext<'_>, path: &[&str]) -> bool { let lang_item_path = cx.get_def_path(*item_def_id); if path_syms.starts_with(&lang_item_path) { if let [item] = &path_syms[lang_item_path.len()..] { - for child in cx.tcx.item_children(*item_def_id) { + for child in cx.tcx.module_children(*item_def_id) { if child.ident.name == *item { return true; } @@ -984,7 +984,7 @@ impl<'tcx> LateLintPass<'tcx> for InterningDefinedSymbol { for &module in &[&paths::KW_MODULE, &paths::SYM_MODULE] { if let Some(def_id) = path_to_res(cx, module).opt_def_id() { - for item in cx.tcx.item_children(def_id).iter() { + for item in cx.tcx.module_children(def_id).iter() { if_chain! { if let Res::Def(DefKind::Const, item_def_id) = item.res; let ty = cx.tcx.type_of(item_def_id); diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index bd6851d1fbb..91ebc7ea89c 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -525,7 +525,7 @@ pub fn path_to_res(cx: &LateContext<'_>, path: &[&str]) -> Res { fn item_child_by_name<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, name: &str) -> Option<Res> { match tcx.def_kind(def_id) { DefKind::Mod | DefKind::Enum | DefKind::Trait => tcx - .item_children(def_id) + .module_children(def_id) .iter() .find(|item| item.ident.name.as_str() == name) .map(|child| child.res.expect_non_local()), diff --git a/tests/ui/macro_use_imports.fixed b/tests/ui/macro_use_imports.fixed index 9171558f3a2..306ea50258d 100644 --- a/tests/ui/macro_use_imports.fixed +++ b/tests/ui/macro_use_imports.fixed @@ -40,7 +40,7 @@ mod a { } } -// issue #7015, ICE due to calling `item_children` with local `DefId` +// issue #7015, ICE due to calling `module_children` with local `DefId` #[macro_use] use a as b; diff --git a/tests/ui/macro_use_imports.rs b/tests/ui/macro_use_imports.rs index cd01fd43f6d..e26a7545ea6 100644 --- a/tests/ui/macro_use_imports.rs +++ b/tests/ui/macro_use_imports.rs @@ -40,7 +40,7 @@ mod a { } } -// issue #7015, ICE due to calling `item_children` with local `DefId` +// issue #7015, ICE due to calling `module_children` with local `DefId` #[macro_use] use a as b; |
