Reuse ErrorGuaranteed during relation
This commit is contained in:
parent
ef4046e4f3
commit
4e30ad8d60
2 changed files with 4 additions and 2 deletions
|
@ -89,7 +89,9 @@ impl<'tcx> TypeRelation<'tcx> for Match<'tcx> {
|
||||||
Err(TypeError::Sorts(relate::expected_found(self, a, b)))
|
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),
|
_ => 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")
|
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::Never, _)
|
||||||
| (&ty::Char, _)
|
| (&ty::Char, _)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue