Skip to content

Commit 8f65cf3

Browse files
spastorinoMark-Simulacrum
authored andcommitted
normalize field projection ty to fix broken MIR issue
1 parent e5f529c commit 8f65cf3

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
690690
let fty = self.sanitize_type(place, fty);
691691
match self.field_ty(place, base, field, location) {
692692
Ok(ty) => {
693+
let ty = self.cx.normalize(ty, location);
693694
if let Err(terr) = self.cx.eq_types(
694695
ty,
695696
fty,

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

Lines changed: 1 addition & 0 deletions
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)