Skip to content

Commit 3657eaa

Browse files
committed
libpanic_unwind => 2018: fix ICEs.
1 parent fba102c commit 3657eaa

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/librustc_typeck/check/method/suggest.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -752,12 +752,11 @@ fn compute_all_traits<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Vec<DefId>
752752
traits: &mut Vec<DefId>,
753753
external_mods: &mut FxHashSet<DefId>,
754754
def: Def) {
755-
let def_id = def.def_id();
756755
match def {
757-
Def::Trait(..) => {
756+
Def::Trait(def_id) => {
758757
traits.push(def_id);
759758
}
760-
Def::Mod(..) => {
759+
Def::Mod(def_id) => {
761760
if !external_mods.insert(def_id) {
762761
return;
763762
}

src/librustdoc/visit_lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ impl<'a, 'tcx, 'rcx> LibEmbargoVisitor<'a, 'tcx, 'rcx> {
6060
}
6161

6262
for item in self.cx.tcx.item_children(def_id).iter() {
63-
if self.cx.tcx.def_key(item.def.def_id()).parent.map_or(false, |d| d == def_id.index) ||
64-
item.vis == Visibility::Public {
65-
self.visit_item(item.def);
63+
if let Some(def_id) = item.def.opt_def_id() {
64+
if self.cx.tcx.def_key(def_id).parent.map_or(false, |d| d == def_id.index) ||
65+
item.vis == Visibility::Public {
66+
self.visit_item(item.def);
67+
}
6668
}
6769
}
6870
}

0 commit comments

Comments
 (0)