Skip to content

Commit 977246e

Browse files
committed
[CS] Use inSalvageMode instead of phase in a couple of places
This seems to better match what the conditions are checking for.
1 parent f182378 commit 977246e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,9 +1828,7 @@ PotentialBindings::inferFromRelational(ConstraintSystem &CS,
18281828
// Since inference now happens during constraint generation,
18291829
// this hack should be allowed in both `Solving`
18301830
// (during non-diagnostic mode) and `ConstraintGeneration` phases.
1831-
if (isGenericParameter(TypeVar) &&
1832-
(!CS.shouldAttemptFixes() ||
1833-
CS.getPhase() == ConstraintSystemPhase::ConstraintGeneration)) {
1831+
if (isGenericParameter(TypeVar) && !CS.inSalvageMode()) {
18341832
type = fnTy->withExtInfo(fnTy->getExtInfo().withNoEscape(false));
18351833
}
18361834
}

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,10 +1808,8 @@ struct TypeSimplifier {
18081808
// so the concrete dependent member type is considered a "hole" in
18091809
// order to continue solving.
18101810
auto memberTy = DependentMemberType::get(lookupBaseType, assocType);
1811-
if (CS.shouldAttemptFixes() &&
1812-
CS.getPhase() == ConstraintSystemPhase::Solving) {
1811+
if (CS.inSalvageMode())
18131812
return PlaceholderType::get(CS.getASTContext(), memberTy);
1814-
}
18151813

18161814
return memberTy;
18171815
}

0 commit comments

Comments
 (0)