Skip to content

Commit 80c48bf

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents 7c60b58 + ae8ab3f commit 80c48bf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/SILOptimizer/Mandatory/SemanticARCOpts.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,13 @@ static bool isConsumed(
100100
return true;
101101
}
102102
case UseLifetimeConstraint::MustBeLive:
103-
// Ok, this constraint can take something owned as live. Lets
104-
// see if it can also take something that is guaranteed. If it
105-
// can not, then we bail.
106-
map.canAcceptKind(ValueOwnershipKind::Guaranteed);
103+
// Ok, this constraint can take something owned as live. Assert that it
104+
// can also accept something that is guaranteed. Any non-consuming use of
105+
// an owned value should be able to take a guaranteed parameter as well
106+
// (modulo bugs). We assert to catch these.
107+
assert(map.canAcceptKind(ValueOwnershipKind::Guaranteed) &&
108+
"Any non-consuming use of an owned value should be able to take a "
109+
"guaranteed value");
107110
continue;
108111
}
109112
}

0 commit comments

Comments
 (0)