mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Mark constant captures for no_consume_or_assign checking instead of may_assign_but_not_consume.
An immutable noncopyable capture borrows the captured value in-place and can't do anything to modify it, and the may_assign_but_not_consume checking behaves badly with some code patterns generated for resilient types when `self` is captured during a deinit. This change allows for more accurate checking and fixes rdar://118427997.
This commit is contained in:
@@ -771,7 +771,7 @@ void SILGenFunction::emitCaptures(SILLocation loc,
|
||||
val = B.createMarkUnresolvedNonCopyableValueInst(
|
||||
loc, val,
|
||||
MarkUnresolvedNonCopyableValueInst::CheckKind::
|
||||
AssignableButNotConsumable);
|
||||
NoConsumeOrAssign);
|
||||
}
|
||||
val = emitLoad(loc, val, tl, SGFContext(), IsNotTake).forward(*this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user