diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-02-13 00:07:22 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-02-13 18:09:09 +0100 |
| commit | f9e9c9196a196e95d8f39aa57ed30857525be5e6 (patch) | |
| tree | b159b89a0a9b96bca5d13b9a7d56477a5db21afc | |
| parent | f2fe12a8ab85ab7e579bcc74246e6c7fea9f1015 (diff) | |
| download | rust-f9e9c9196a196e95d8f39aa57ed30857525be5e6.tar.gz rust-f9e9c9196a196e95d8f39aa57ed30857525be5e6.zip | |
libpanic_unwind => 2018: fix ICEs.
| -rw-r--r-- | src/librustc_typeck/check/method/suggest.rs | 5 | ||||
| -rw-r--r-- | src/librustdoc/visit_lib.rs | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index aa6f73b29b4..b3248018b55 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -752,12 +752,11 @@ fn compute_all_traits<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Vec<DefId> traits: &mut Vec<DefId>, external_mods: &mut FxHashSet<DefId>, def: Def) { - let def_id = def.def_id(); match def { - Def::Trait(..) => { + Def::Trait(def_id) => { traits.push(def_id); } - Def::Mod(..) => { + Def::Mod(def_id) => { if !external_mods.insert(def_id) { return; } diff --git a/src/librustdoc/visit_lib.rs b/src/librustdoc/visit_lib.rs index 7413a917f05..bd5cae861e9 100644 --- a/src/librustdoc/visit_lib.rs +++ b/src/librustdoc/visit_lib.rs @@ -60,9 +60,11 @@ impl<'a, 'tcx, 'rcx> LibEmbargoVisitor<'a, 'tcx, 'rcx> { } for item in self.cx.tcx.item_children(def_id).iter() { - if self.cx.tcx.def_key(item.def.def_id()).parent.map_or(false, |d| d == def_id.index) || - item.vis == Visibility::Public { - self.visit_item(item.def); + if let Some(def_id) = item.def.opt_def_id() { + if self.cx.tcx.def_key(def_id).parent.map_or(false, |d| d == def_id.index) || + item.vis == Visibility::Public { + self.visit_item(item.def); + } } } } |
