]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir/src/intravisit.rs
Replace FnLikeNode by FnKind.
[rust.git] / compiler / rustc_hir / src / intravisit.rs
index 3e58af1f167aa628ec650a2a4d6eb546dccec9ff..cff543760f42af954123f20e1bd85c4876e92e02 100644 (file)
@@ -117,6 +117,14 @@ pub fn header(&self) -> Option<&FnHeader> {
             FnKind::Closure => None,
         }
     }
+
+    pub fn constness(self) -> Constness {
+        self.header().map_or(Constness::NotConst, |header| header.constness)
+    }
+
+    pub fn asyncness(self) -> IsAsync {
+        self.header().map_or(IsAsync::NotAsync, |header| header.asyncness)
+    }
 }
 
 /// An abstract representation of the HIR `rustc_middle::hir::map::Map`.