1
Fork 0

Rollup merge of #101022 - compiler-errors:issue-101020, r=jackh726

Erase late bound regions before comparing types in `suggest_dereferences`

Fixes #101020
This commit is contained in:
Dylan DPC 2022-08-30 11:26:50 +05:30 committed by GitHub
commit 1ea84961e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 5 deletions

View file

@ -2725,7 +2725,10 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
a: ty::Region<'tcx>,
b: ty::Region<'tcx>,
) -> RelateResult<'tcx, ty::Region<'tcx>> {
if (a.is_var() && b.is_free_or_static()) || (b.is_var() && a.is_free_or_static()) || a == b
if (a.is_var() && b.is_free_or_static())
|| (b.is_var() && a.is_free_or_static())
|| (a.is_var() && b.is_var())
|| a == b
{
Ok(a)
} else {