Skip to content

Commit

Permalink
Rollup merge of #71488 - spastorino:normalize-ty-to-fix-broken-mir, r…
Browse files Browse the repository at this point in the history
…=eddyb

normalize field projection ty to fix broken MIR issue

Fixes #71344

r? @eddyb
  • Loading branch information
Dylan-DPC authored Apr 28, 2020
2 parents d9c1f5c + 7bafb57 commit 5aebbe9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_mir/borrow_check/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
let fty = self.sanitize_type(place, fty);
match self.field_ty(place, base, field, location) {
Ok(ty) => {
let ty = self.cx.normalize(ty, location);
if let Err(terr) = self.cx.eq_types(
ty,
fty,
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/consts/issue-70773-mir-typeck-lt-norm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fn init_hash(_: &mut [u8; HASH_LEN]) {}
fn foo<'a>() -> &'a () {
Hash([0; HASH_LEN]);
init_hash(&mut [0; HASH_LEN]);
let (_array,) = ([0; HASH_LEN],);
&()
}

Expand Down

0 comments on commit 5aebbe9

Please sign in to comment.