Skip to content

Commit 81571bf

Browse files
Centriloli-obk
authored andcommitted
libpanic_unwind => 2018: fix ICEs.
1 parent b203178 commit 81571bf

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
@@ -750,12 +750,11 @@ fn compute_all_traits<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Vec<DefId>
750750
traits: &mut Vec<DefId>,
751751
external_mods: &mut FxHashSet<DefId>,
752752
def: Def) {
753-
let def_id = def.def_id();
754753
match def {
755-
Def::Trait(..) => {
754+
Def::Trait(def_id) => {
756755
traits.push(def_id);
757756
}
758-
Def::Mod(..) => {
757+
Def::Mod(def_id) => {
759758
if !external_mods.insert(def_id) {
760759
return;
761760
}

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)