mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen introduces a copy of the capture, because the semantics of escaping partial_apply's requires the closure to take ownership of the parameters. We don't know when a closure is strictly nonescaping or its final lifetime until ClosureLifetimeFixup runs, but that replaces the consume of the copy with a borrow of the copy normally, hoping later passes fix it up. We can't wait that long for move-only types, which can't be copied, so try to remove the copy up front when the copy lives long enough and has no interfering uses other than the partial_apply. rdar://110137169
72 KiB
72 KiB