1
Fork 0

Rollup merge of #78739 - hameerabbasi:issue-78654, r=nikomatsakis

Fix ICE on type error in async function

Fixes #78654
This commit is contained in:
Mara Bos 2020-11-05 10:29:57 +01:00 committed by GitHub
commit 171d29c9c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 0 deletions

View file

@ -605,6 +605,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let ret_ty = self.inh.infcx.shallow_resolve(ret_ty);
let ret_vid = match *ret_ty.kind() {
ty::Infer(ty::TyVar(ret_vid)) => ret_vid,
ty::Error(_) => return None,
_ => span_bug!(
self.tcx.def_span(expr_def_id),
"async fn generator return type not an inference variable"