mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A struct or tuple value can have "none" ownership even if its type is not trivial. This happens when the struct/tuple contains a non-trivial enum, but it's initialized with a trivial enum case (e.g. with `Optional.none`). ``` %1 = enum $Optional<String>, #Optional.none!enumelt %2 = struct $S (%32) // has ownership "none" %3 = struct_extract %2, #S.x // should also have ownership "none" and not "guaranteed" ``` So far it got "guaranteed" ownership which is clearly wrong. Fixes an assertion crash in redundant load elimination. https://github.com/swiftlang/swift/issues/80430 rdar://148311534
34 KiB
34 KiB