Skip to content

Commit 8b99812

Browse files
committed
RequirementMachine: Stricter RewriteSystem::verifyRewriteRules()
1 parent 8df7ca0 commit 8b99812

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/AST/RequirementMachine/RewriteSystem.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,6 @@ void RewriteSystem::verifyRewriteRules(ValidityPolicy policy) const {
668668
// Completion can produce rules like [P:T].[Q].[R] => [P:T].[Q]
669669
// which are immediately simplified away.
670670
if (!rule.isLHSSimplified() &&
671-
!rule.isRHSSimplified() &&
672-
!rule.isSubstitutionSimplified() &&
673671
index != 0 && index != lhs.size() - 1) {
674672
ASSERT_RULE(symbol.getKind() != Symbol::Kind::Protocol);
675673
}
@@ -680,9 +678,7 @@ void RewriteSystem::verifyRewriteRules(ValidityPolicy policy) const {
680678

681679
// Permanent rules contain name symbols at the end, like
682680
// [P].T => [P:T].
683-
if (!rule.isLHSSimplified() &&
684-
!rule.isRHSSimplified() &&
685-
!rule.isSubstitutionSimplified() &&
681+
if (!rule.isRHSSimplified() &&
686682
(!rule.isPermanent() || index == rhs.size() - 1)) {
687683
// This is only true if the input requirements were valid.
688684
if (policy == DisallowInvalidRequirements) {
@@ -701,10 +697,7 @@ void RewriteSystem::verifyRewriteRules(ValidityPolicy policy) const {
701697

702698
// Completion can produce rules like [P:T].[Q].[R] => [P:T].[Q]
703699
// which are immediately simplified away.
704-
if (!rule.isLHSSimplified() &&
705-
!rule.isRHSSimplified() &&
706-
!rule.isSubstitutionSimplified() &&
707-
index != 0) {
700+
if (!rule.isRHSSimplified() && index != 0) {
708701
ASSERT_RULE(symbol.getKind() != Symbol::Kind::Protocol);
709702
}
710703
}

0 commit comments

Comments
 (0)