Remove some unnecessary erases
This commit is contained in:
parent
e964ccafed
commit
292ecd5242
3 changed files with 1 additions and 7 deletions
|
|
@ -490,11 +490,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
|
|||
&& let Some(from_trait) = fcx.tcx.get_diagnostic_item(sym::From)
|
||||
{
|
||||
let ty = fcx.resolve_vars_if_possible(self.cast_ty);
|
||||
// Erase regions to avoid panic in `prove_value` when calling
|
||||
// `type_implements_trait`.
|
||||
let ty = fcx.tcx.erase_regions(ty);
|
||||
let expr_ty = fcx.resolve_vars_if_possible(self.expr_ty);
|
||||
let expr_ty = fcx.tcx.erase_regions(expr_ty);
|
||||
if fcx
|
||||
.infcx
|
||||
.type_implements_trait(from_trait, [ty, expr_ty], fcx.param_env)
|
||||
|
|
|
|||
|
|
@ -1453,9 +1453,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
|
|||
// contain named regions. So we erase and anonymize everything
|
||||
// here to compare the types modulo regions below.
|
||||
let proj = cx.tcx().erase_regions(proj);
|
||||
let proj = cx.tcx().anonymize_bound_vars(proj);
|
||||
let super_proj = cx.tcx().erase_regions(super_proj);
|
||||
let super_proj = cx.tcx().anonymize_bound_vars(super_proj);
|
||||
|
||||
proj == super_proj
|
||||
});
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for SubTypeChecker<'a, 'tcx> {
|
|||
let mut rval_ty = rvalue.ty(self.local_decls, self.tcx);
|
||||
// Not erasing this causes `Free Regions` errors in validator,
|
||||
// when rval is `ReStatic`.
|
||||
rval_ty = self.tcx.erase_regions_ty(rval_ty);
|
||||
rval_ty = self.tcx.erase_regions(rval_ty);
|
||||
place_ty = self.tcx.erase_regions(place_ty);
|
||||
if place_ty != rval_ty {
|
||||
let temp = self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue