Resolve projections during internal mutability analysis

This commit is contained in:
Pavel Grigorenko 2025-02-01 02:30:50 +03:00
parent d79f86255d
commit 58d4834097
4 changed files with 96 additions and 0 deletions

View file

@ -1227,6 +1227,10 @@ impl<'tcx> InteriorMut<'tcx> {
.find_map(|f| self.interior_mut_ty_chain(cx, f.ty(cx.tcx, args)))
}
},
ty::Alias(ty::Projection, _) => match cx.tcx.try_normalize_erasing_regions(cx.typing_env(), ty) {
Ok(normalized_ty) if ty != normalized_ty => self.interior_mut_ty_chain(cx, normalized_ty),
_ => None,
},
_ => None,
};