]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_metadata/decoder.rs
Rollup merge of #64599 - csmoe:doc_async_reexport, r=nikomatsakis
[rust.git] / src / librustc_metadata / decoder.rs
index 34c84b1d79d4b0030a418cb4328bb94bb407f952..247748eb3eba5285b57b3aad29c70207b018f27b 100644 (file)
@@ -1212,6 +1212,15 @@ pub fn get_macro(&self, id: DefIndex) -> MacroDef {
         constness == hir::Constness::Const
     }
 
+    pub fn asyncness(&self, id: DefIndex) -> hir::IsAsync {
+         match self.entry(id).kind {
+            EntryKind::Fn(data) => data.decode(self).asyncness,
+            EntryKind::Method(data) => data.decode(self).fn_data.asyncness,
+            EntryKind::ForeignFn(data) => data.decode(self).asyncness,
+            _ => bug!("asyncness: expect functions entry."),
+        }
+    }
+
     pub fn is_foreign_item(&self, id: DefIndex) -> bool {
         match self.entry(id).kind {
             EntryKind::ForeignImmStatic |