normalize field projection ty to fix broken MIR issue

This commit is contained in:
Santiago Pastorino 2020-04-23 18:14:01 -03:00
parent 66f7a5d92f
commit 7bafb5704d
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
2 changed files with 2 additions and 0 deletions

View file

@ -686,6 +686,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,

View file

@ -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],);
&()
}