Skip to content

Commit 6ebd336

Browse files
committed
For us this mostly means changing `hir::exports::Export` to `metadata::ModChild` and `tcx.item_children` to `tcx.module_children`.
1 parent 1246e15 commit 6ebd336

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# NOTE: Keep in sync with nightly date on README
22
[toolchain]
3-
channel = "nightly-2021-12-31"
3+
channel = "nightly-2022-01-10"
44
components = ["llvm-tools-preview", "rustc-dev"]

src/mapping.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_hir::{
99
HirId,
1010
};
1111
use rustc_middle::{
12-
hir::exports::Export,
12+
metadata::ModChild,
1313
ty::{AssocKind, GenericParamDef, GenericParamDefKind},
1414
};
1515
use rustc_span::symbol::Symbol;
@@ -325,7 +325,7 @@ impl IdMapping {
325325
}
326326

327327
/// An export that could be missing from one of the crate versions.
328-
type OptionalExport = Option<Export>;
328+
type OptionalExport = Option<ModChild>;
329329

330330
/// A mapping from names to pairs of old and new exports.
331331
///
@@ -343,7 +343,7 @@ pub struct NameMapping {
343343

344344
impl NameMapping {
345345
/// Insert a single export in the appropriate map, at the appropriate position.
346-
fn insert(&mut self, item: Export, old: bool) {
346+
fn insert(&mut self, item: ModChild, old: bool) {
347347
use rustc_hir::def::DefKind::*;
348348
use rustc_hir::def::Res::*;
349349

@@ -397,7 +397,7 @@ impl NameMapping {
397397
}
398398

399399
/// Add all items from two vectors of old/new exports.
400-
pub fn add(&mut self, old_items: Vec<Export>, new_items: Vec<Export>) {
400+
pub fn add(&mut self, old_items: Vec<ModChild>, new_items: Vec<ModChild>) {
401401
for item in old_items {
402402
self.insert(item, true);
403403
}
@@ -408,7 +408,7 @@ impl NameMapping {
408408
}
409409

410410
/// Drain the item pairs being stored.
411-
pub fn drain(&mut self) -> impl Iterator<Item = (Option<Export>, Option<Export>)> + '_ {
411+
pub fn drain(&mut self) -> impl Iterator<Item = (Option<ModChild>, Option<ModChild>)> + '_ {
412412
self.type_map
413413
.drain()
414414
.chain(self.value_map.drain())

src/traverse.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use rustc_hir::hir_id::HirId;
2323
use rustc_hir::lang_items::LangItem;
2424
use rustc_infer::infer::TyCtxtInferExt;
2525
use rustc_middle::{
26-
hir::exports::Export,
26+
metadata::ModChild,
2727
ty::{
2828
subst::{InternalSubsts, Subst},
2929
AssocItem, GenericParamDef, GenericParamDefKind, Generics, TraitRef, Ty, TyCtxt, TyKind,
@@ -67,7 +67,7 @@ pub fn run_analysis(tcx: TyCtxt, old: DefId, new: DefId) -> ChangeSet {
6767
}
6868

6969
// Get the visibility of the inner item, given the outer item's visibility.
70-
fn get_vis(outer_vis: Visibility, def: Export) -> Visibility {
70+
fn get_vis(outer_vis: Visibility, def: ModChild) -> Visibility {
7171
if outer_vis == Public {
7272
def.vis
7373
} else {
@@ -85,7 +85,7 @@ pub fn run_traversal(tcx: TyCtxt, new: DefId) {
8585

8686
// Pull a module from the queue, with its global visibility.
8787
while let Some((new_def_id, idents, new_vis)) = mod_queue.pop_front() {
88-
for item in tcx.item_children(new_def_id).iter().copied() {
88+
for item in tcx.module_children(new_def_id).iter().copied() {
8989
let n_vis = get_vis(new_vis, item);
9090
match item.res {
9191
Def(Mod, n_def_id) => {
@@ -147,8 +147,8 @@ fn diff_structure<'tcx>(
147147
// Pull a matched module pair from the queue, with the modules' global visibility.
148148
while let Some((old_def_id, new_def_id, old_vis, new_vis)) = mod_queue.pop_front() {
149149
children.add(
150-
tcx.item_children(old_def_id).to_vec(), // TODO: clean up
151-
tcx.item_children(new_def_id).to_vec(),
150+
tcx.module_children(old_def_id).to_vec(), // TODO: clean up
151+
tcx.module_children(new_def_id).to_vec(),
152152
);
153153

154154
for items in children.drain() {

0 commit comments

Comments
 (0)