Skip to content

Commit

Permalink
also normalize_erasing_regions
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jun 22, 2020
1 parent 93e3552 commit 9576e30
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/librustc_mir/transform/validate.rs
Expand Up @@ -89,6 +89,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
// Equal types, all is good.
return true;
}
// Normalize projections and things like that.
let src = self.tcx.normalize_erasing_regions(self.param_env, src);
let dest = self.tcx.normalize_erasing_regions(self.param_env, dest);
// It's worth checking equality again.
if src == dest {
return true;
}

// Type-changing assignments can happen for (at least) two reasons:
// 1. `&mut T` -> `&T` gets optimized from a reborrow to a mere assignment.
Expand Down

0 comments on commit 9576e30

Please sign in to comment.