Merge pull request #73611 from eeckstein/fix-store-runtime-effects

SIL: fix runtime effects of initializing store
This commit is contained in:
eeckstein
2024-05-14 16:58:35 +02:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -781,9 +781,8 @@ RuntimeEffect swift::getRuntimeEffect(SILInstruction *inst, SILType &impactType)
switch (cast<StoreInst>(inst)->getOwnershipQualifier()) {
case StoreOwnershipQualifier::Unqualified:
case StoreOwnershipQualifier::Trivial:
return RuntimeEffect::NoEffect;
case StoreOwnershipQualifier::Init:
return RuntimeEffect::RefCounting;
return RuntimeEffect::NoEffect;
case StoreOwnershipQualifier::Assign:
return RuntimeEffect::Releasing;
}

View File

@@ -505,3 +505,12 @@ func testLargeTuple() {
_ = GenericStruct<SixInt8s>()
}
struct NonCopyableStruct: ~Copyable {
func foo() {}
}
@_noLocks
func testNonCopyable() {
let t = NonCopyableStruct()
t.foo()
}