Skip to content

Commit 7bafb57

Browse files
committed
normalize field projection ty to fix broken MIR issue
1 parent 66f7a5d commit 7bafb57

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
@@ -686,6 +686,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
686686
let fty = self.sanitize_type(place, fty);
687687
match self.field_ty(place, base, field, location) {
688688
Ok(ty) => {
689+
let ty = self.cx.normalize(ty, location);
689690
if let Err(terr) = self.cx.eq_types(
690691
ty,
691692
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)