From daa0094eb791442c7f89645f00c5f33dbb9bf308 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Fri, 28 Apr 2017 01:28:22 -0700 Subject: Queryify is_item_mir_available --- src/librustc_metadata/decoder.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/librustc_metadata/decoder.rs') diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 2317c156b41..933166b0524 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -441,11 +441,11 @@ impl<'tcx> EntryKind<'tcx> { } impl<'a, 'tcx> CrateMetadata { - fn is_proc_macro(&self, id: DefIndex) -> bool { + pub fn is_proc_macro(&self, id: DefIndex) -> bool { self.proc_macros.is_some() && id != CRATE_DEF_INDEX } - fn maybe_entry(&self, item_id: DefIndex) -> Option>> { + pub fn maybe_entry(&self, item_id: DefIndex) -> Option>> { assert!(!self.is_proc_macro(item_id)); self.root.index.lookup(self.blob.raw_bytes(), item_id) } @@ -772,11 +772,6 @@ impl<'a, 'tcx> CrateMetadata { tcx.alloc_tables(ast.tables.decode((self, tcx))) } - pub fn is_item_mir_available(&self, id: DefIndex) -> bool { - !self.is_proc_macro(id) && - self.maybe_entry(id).and_then(|item| item.decode(self).mir).is_some() - } - pub fn maybe_get_item_mir(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefIndex) -- cgit 1.4.1-3-g733a5