We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
unchecked_ownership_conversion
1 parent 9de2419 commit 55d1e82Copy full SHA for 55d1e82
lib/SIL/Verifier/SILOwnershipVerifier.cpp
@@ -658,6 +658,15 @@ bool SILValueOwnershipChecker::checkValueWithoutLifetimeEndingUses(
658
}
659
660
661
+ if (auto *uoc = dyn_cast<UncheckedOwnershipConversionInst>(value)) {
662
+ // When converting from `unowned`, which can happen for ObjectiveC blocks,
663
+ // we don't require and scope-ending instruction. This falls in the category:
664
+ // "trust me, I know what I'm doing".
665
+ if (uoc->getOperand()->getOwnershipKind() == OwnershipKind::Unowned) {
666
+ return true;
667
+ }
668
669
+
670
// If we have an unowned value, then again there is nothing left to do.
671
if (value->getOwnershipKind() == OwnershipKind::Unowned)
672
return true;
0 commit comments