File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,13 @@ static bool isConsumed(
100
100
return true ;
101
101
}
102
102
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" );
107
110
continue ;
108
111
}
109
112
}
You can’t perform that action at this time.
0 commit comments