diff options
Diffstat (limited to 'compiler/rustc_metadata/src/rmeta/decoder.rs')
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index 40f8da43c66..d8d2ac32c2f 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -1114,7 +1114,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { fn get_fn_has_self_parameter(self, id: DefIndex) -> bool { match self.kind(id) { - EntryKind::AssocFn(data) => data.decode(self).has_self, + EntryKind::AssocFn { has_self, .. } => has_self, _ => false, } } @@ -1134,18 +1134,13 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { } fn get_associated_item(self, id: DefIndex) -> ty::AssocItem { - let def_key = self.def_key(id); - let parent = self.local_def_id(def_key.parent.unwrap()); let name = self.item_name(id); let (kind, container, has_self) = match self.kind(id) { EntryKind::AssocConst(container) => (ty::AssocKind::Const, container, false), - EntryKind::AssocFn(data) => { - let data = data.decode(self); - (ty::AssocKind::Fn, data.container, data.has_self) - } + EntryKind::AssocFn { container, has_self } => (ty::AssocKind::Fn, container, has_self), EntryKind::AssocType(container) => (ty::AssocKind::Type, container, false), - _ => bug!("cannot get associated-item of `{:?}`", def_key), + _ => bug!("cannot get associated-item of `{:?}`", id), }; ty::AssocItem { @@ -1153,7 +1148,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { kind, def_id: self.local_def_id(id), trait_item_def_id: self.get_trait_item_def_id(id), - container: container.with_def_id(parent), + container, fn_has_self_parameter: has_self, } } |
