diff --git a/src/librustc_mir/borrow_check/type_check/mod.rs b/src/librustc_mir/borrow_check/type_check/mod.rs index d60ab2b81fd..7f554742777 100644 --- a/src/librustc_mir/borrow_check/type_check/mod.rs +++ b/src/librustc_mir/borrow_check/type_check/mod.rs @@ -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, diff --git a/src/test/ui/consts/issue-70773-mir-typeck-lt-norm.rs b/src/test/ui/consts/issue-70773-mir-typeck-lt-norm.rs index 07af8310424..9d44aa1361c 100644 --- a/src/test/ui/consts/issue-70773-mir-typeck-lt-norm.rs +++ b/src/test/ui/consts/issue-70773-mir-typeck-lt-norm.rs @@ -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],); &() }