name async generators something more human friendly in type error diagnostics

This commit is contained in:
Gus Wynn 2021-01-28 18:16:52 -08:00
parent b05fd2a15d
commit c28d86c53b
8 changed files with 103 additions and 17 deletions

View file

@ -1366,8 +1366,8 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
Some(t) => Some(t),
None => {
let ty = parent_trait_ref.skip_binder().self_ty();
let span =
TyCategory::from_ty(ty).map(|(_, def_id)| self.tcx.def_span(def_id));
let span = TyCategory::from_ty(self.tcx, ty)
.map(|(_, def_id)| self.tcx.def_span(def_id));
Some((ty.to_string(), span))
}
}