Replace FnLikeNode by FnKind.

This commit is contained in:
Camille GILLOT
2021-10-19 23:31:51 +02:00
parent 05eb6f36f1
commit 6e98688e68
11 changed files with 47 additions and 102 deletions

View File

@@ -117,6 +117,14 @@ impl<'a> FnKind<'a> {
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`.