review comments 2 electric boogalo

This commit is contained in:
Boxy 2022-11-18 13:45:42 +00:00
parent 9ed348376f
commit 45a09a4683
2 changed files with 4 additions and 5 deletions

View File

@ -1440,12 +1440,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if !ty.is_ty_var() {
ty
} else {
if let None = self.tainted_by_errors() {
let e = self.tainted_by_errors().unwrap_or_else(|| {
self.err_ctxt()
.emit_inference_failure_err((**self).body_id, sp, ty.into(), E0282, true)
.emit();
}
let err = self.tcx.ty_error();
.emit()
});
let err = self.tcx.ty_error_with_guaranteed(e);
self.demand_suptype(sp, err, ty);
err
}

View File

@ -73,7 +73,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let ty = self.typeck_results.borrow().expr_ty_adjusted(expr);
let ty = self.resolve_vars_if_possible(ty);
if ty.has_non_region_infer() {
assert!(self.tainted_by_errors().is_some());
self.tcx.ty_error()
} else {
self.tcx.erase_regions(ty)