}
}
+/// Check if a function is async.
+fn asyncness(tcx: TyCtxt<'_>, def_id: DefId) -> hir::IsAsync {
+ let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap_or_else(|| {
+ bug!("asyncness: expected local `DefId`, got `{:?}`", def_id)
+ });
+
+ let node = tcx.hir().get(hir_id);
+
+ let fn_like = hir::map::blocks::FnLikeNode::from_node(node).unwrap_or_else(|| {
+ bug!("asyncness: expected fn-like node but got `{:?}`", def_id);
+ });
+
+ fn_like.asyncness()
+}
+
+
pub fn provide(providers: &mut ty::query::Providers<'_>) {
context::provide(providers);
erase_regions::provide(providers);
util::provide(providers);
constness::provide(providers);
*providers = ty::query::Providers {
+ asyncness,
associated_item,
associated_item_def_ids,
adt_sized_constraint,