From a813cc1bf190f9cdcd7dce2eba287c637ce4048f Mon Sep 17 00:00:00 2001 From: csmoe Date: Sat, 21 Sep 2019 03:17:57 +0000 Subject: rename is_async_fn to asyncness --- src/librustc/query/mod.rs | 2 +- src/librustc/ty/mod.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/librustc') diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 5e1db92b555..252e49d5d15 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -244,7 +244,7 @@ rustc_queries! { desc { |tcx| "checking if item is const fn: `{}`", tcx.def_path_str(key) } } - query is_async_fn(key: DefId) -> bool { + query asyncness(key: DefId) -> hir::IsAsync { desc { |tcx| "checking if the function is async: `{}`", tcx.def_path_str(key) } } diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 97981f47820..dd36a452092 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -3349,16 +3349,17 @@ fn issue33140_self_ty(tcx: TyCtxt<'_>, def_id: DefId) -> Option> { } } -fn is_async_fn(tcx: TyCtxt<'_>, def_id: DefId) -> bool { +/// Check if a function is async. +fn asyncness(tcx: TyCtxt<'_>, def_id: DefId) -> hir::IsAsync { if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) { let node = tcx.hir().get(hir_id); if let Some(fn_like) = hir::map::blocks::FnLikeNode::from_node(node) { - fn_like.asyncness() == hir::IsAsync::Async + fn_like.asyncness() } else { - false + hir::IsAsync::NotAsync } } else { - false + hir::IsAsync::NotAsync } } @@ -3370,7 +3371,7 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) { util::provide(providers); constness::provide(providers); *providers = ty::query::Providers { - is_async_fn, + asyncness, associated_item, associated_item_def_ids, adt_sized_constraint, -- cgit 1.4.1-3-g733a5