Skip to content

Commit c8ea042

Browse files
committed
rustc_metadata: Rename item_children(_untracked) to module_children(_untracked)
And `each_child_of_item` to `for_each_module_child`
1 parent 1288b80 commit c8ea042

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

clippy_lints/src/macro_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for MacroUseImports {
9696
if let Res::Def(DefKind::Mod, id) = path.res;
9797
if !id.is_local();
9898
then {
99-
for kid in cx.tcx.item_children(id).iter() {
99+
for kid in cx.tcx.module_children(id).iter() {
100100
if let Res::Def(DefKind::Macro(_mac_type), mac_id) = kid.res {
101101
let span = mac_attr.span;
102102
let def_path = cx.tcx.def_path_str(mac_id);

clippy_lints/src/utils/internal_lints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ pub fn check_path(cx: &LateContext<'_>, path: &[&str]) -> bool {
924924
let lang_item_path = cx.get_def_path(*item_def_id);
925925
if path_syms.starts_with(&lang_item_path) {
926926
if let [item] = &path_syms[lang_item_path.len()..] {
927-
for child in cx.tcx.item_children(*item_def_id) {
927+
for child in cx.tcx.module_children(*item_def_id) {
928928
if child.ident.name == *item {
929929
return true;
930930
}
@@ -984,7 +984,7 @@ impl<'tcx> LateLintPass<'tcx> for InterningDefinedSymbol {
984984

985985
for &module in &[&paths::KW_MODULE, &paths::SYM_MODULE] {
986986
if let Some(def_id) = path_to_res(cx, module).opt_def_id() {
987-
for item in cx.tcx.item_children(def_id).iter() {
987+
for item in cx.tcx.module_children(def_id).iter() {
988988
if_chain! {
989989
if let Res::Def(DefKind::Const, item_def_id) = item.res;
990990
let ty = cx.tcx.type_of(item_def_id);

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ pub fn path_to_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
525525
fn item_child_by_name<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, name: &str) -> Option<Res> {
526526
match tcx.def_kind(def_id) {
527527
DefKind::Mod | DefKind::Enum | DefKind::Trait => tcx
528-
.item_children(def_id)
528+
.module_children(def_id)
529529
.iter()
530530
.find(|item| item.ident.name.as_str() == name)
531531
.map(|child| child.res.expect_non_local()),

tests/ui/macro_use_imports.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod a {
4040
}
4141
}
4242

43-
// issue #7015, ICE due to calling `item_children` with local `DefId`
43+
// issue #7015, ICE due to calling `module_children` with local `DefId`
4444
#[macro_use]
4545
use a as b;
4646

tests/ui/macro_use_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod a {
4040
}
4141
}
4242

43-
// issue #7015, ICE due to calling `item_children` with local `DefId`
43+
// issue #7015, ICE due to calling `module_children` with local `DefId`
4444
#[macro_use]
4545
use a as b;
4646

0 commit comments

Comments
 (0)