about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorcsmoe <csmoe@msn.com>2019-09-21 03:17:57 +0000
committercsmoe <csmoe@msn.com>2019-09-21 03:17:57 +0000
commita813cc1bf190f9cdcd7dce2eba287c637ce4048f (patch)
tree4ef07df95341cd37db30d0edf139cc2e183fdb75 /src/librustc
parent9ffb1ce28cb1656d6142f1f9f6f882eb187fac25 (diff)
downloadrust-a813cc1bf190f9cdcd7dce2eba287c637ce4048f.tar.gz
rust-a813cc1bf190f9cdcd7dce2eba287c637ce4048f.zip
rename is_async_fn to asyncness
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/query/mod.rs2
-rw-r--r--src/librustc/ty/mod.rs11
2 files changed, 7 insertions, 6 deletions
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<Ty<'_>> {
     }
 }
 
-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,