about summary refs log tree commit diff
path: root/src/librustc_metadata/decoder.rs
diff options
context:
space:
mode:
authorTaylor Cramer <cramertaylorj@gmail.com>2017-04-28 01:28:22 -0700
committerTaylor Cramer <cramertj@google.com>2017-05-01 10:24:10 -0700
commitdaa0094eb791442c7f89645f00c5f33dbb9bf308 (patch)
treec9131fd8bc1cb0289acc0f550bd305879ef26ba5 /src/librustc_metadata/decoder.rs
parentfb4380b12db03264afbd085e1f654b0a38ecc3f2 (diff)
downloadrust-daa0094eb791442c7f89645f00c5f33dbb9bf308.tar.gz
rust-daa0094eb791442c7f89645f00c5f33dbb9bf308.zip
Queryify is_item_mir_available
Diffstat (limited to 'src/librustc_metadata/decoder.rs')
-rw-r--r--src/librustc_metadata/decoder.rs9
1 files changed, 2 insertions, 7 deletions
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<Lazy<Entry<'tcx>>> {
+    pub fn maybe_entry(&self, item_id: DefIndex) -> Option<Lazy<Entry<'tcx>>> {
         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)