Reuse ErrorGuaranteed during relation
This commit is contained in:
parent
ef4046e4f3
commit
4e30ad8d60
@ -89,7 +89,9 @@ fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
|
||||
Err(TypeError::Sorts(relate::expected_found(self, a, b)))
|
||||
}
|
||||
|
||||
(&ty::Error(_), _) | (_, &ty::Error(_)) => Ok(self.tcx().ty_error()),
|
||||
(&ty::Error(guar), _) | (_, &ty::Error(guar)) => {
|
||||
Ok(self.tcx().ty_error_with_guaranteed(guar))
|
||||
}
|
||||
|
||||
_ => relate::super_relate_tys(self, a, b),
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ pub fn super_relate_tys<'tcx, R: TypeRelation<'tcx>>(
|
||||
bug!("bound types encountered in super_relate_tys")
|
||||
}
|
||||
|
||||
(&ty::Error(_), _) | (_, &ty::Error(_)) => Ok(tcx.ty_error()),
|
||||
(&ty::Error(guar), _) | (_, &ty::Error(guar)) => Ok(tcx.ty_error_with_guaranteed(guar)),
|
||||
|
||||
(&ty::Never, _)
|
||||
| (&ty::Char, _)
|
||||
|
Loading…
Reference in New Issue
Block a user