Skip to content

Commit 5aebbe9

Browse files
authored
Rollup merge of #71488 - spastorino:normalize-ty-to-fix-broken-mir, r=eddyb
normalize field projection ty to fix broken MIR issue Fixes #71344 r? @eddyb
2 parents d9c1f5c + 7bafb57 commit 5aebbe9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/librustc_mir/borrow_check/type_check/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
689689
let fty = self.sanitize_type(place, fty);
690690
match self.field_ty(place, base, field, location) {
691691
Ok(ty) => {
692+
let ty = self.cx.normalize(ty, location);
692693
if let Err(terr) = self.cx.eq_types(
693694
ty,
694695
fty,

src/test/ui/consts/issue-70773-mir-typeck-lt-norm.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ fn init_hash(_: &mut [u8; HASH_LEN]) {}
77
fn foo<'a>() -> &'a () {
88
Hash([0; HASH_LEN]);
99
init_hash(&mut [0; HASH_LEN]);
10+
let (_array,) = ([0; HASH_LEN],);
1011
&()
1112
}
1213

0 commit comments

Comments
 (0)