From 252ac152864528ef0a6f0a54458e1ecf07a7ddfc Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 10 Jan 2024 10:25:42 +0000 Subject: [PATCH] Bubble up error type --- compiler/rustc_hir_typeck/src/closure.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_hir_typeck/src/closure.rs b/compiler/rustc_hir_typeck/src/closure.rs index 7edb5912dd53..b6b332993151 100644 --- a/compiler/rustc_hir_typeck/src/closure.rs +++ b/compiler/rustc_hir_typeck/src/closure.rs @@ -802,7 +802,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { .explicit_item_bounds(def_id) .iter_instantiated_copied(self.tcx, args) .find_map(|(p, s)| get_future_output(p.as_predicate(), s))?, - ty::Error(_) => return None, + ty::Error(_) => return Some(ret_ty), _ => span_bug!( closure_span, "async fn coroutine return type not an inference variable: {ret_ty}"