Skip to content

Commit 98dbfae

Browse files
committed
[no-implicit-copy] Assert in SILBuilder that mark_must_check only can take a MoveOnlyWrapped value.
In the future, we may not have this requirement, but for now it is a really convenient way to track down places in SILGen where I have missed converting from copyable to moveonlywrapped types.
1 parent e9caee9 commit 98dbfae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7580,7 +7580,10 @@ class MarkMustCheckInst
75807580
: UnaryInstructionBase(DebugLoc, operand, operand->getType()),
75817581
OwnershipForwardingMixin(SILInstructionKind::MarkMustCheckInst,
75827582
operand->getOwnershipKind()),
7583-
kind(checkKind) {}
7583+
kind(checkKind) {
7584+
assert(operand->getType().isMoveOnlyWrapped() &&
7585+
"mark_must_check can only take a move only wrapped value");
7586+
}
75847587

75857588
public:
75867589
CheckKind getCheckKind() const { return kind; }

0 commit comments

Comments
 (0)