Skip to content

Commit f956b26

Browse files
authored
Merge pull request #85352 from kavon/test-moveonly-rdar162749287
Test: ~Copyable passed inout within closure
2 parents 27a7334 + 3e3e93b commit f956b26

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/SILOptimizer/moveonly_correct.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,17 @@ public struct M_109232806: ~Copyable {
2323
}
2424
public func test_109232806(m: borrowing M_109232806) {
2525
_ = m.y
26+
}
27+
28+
29+
// rdar://162749287
30+
struct DonutEventHandler: ~Copyable {
31+
mutating func deliciouslyDo<Result>(
32+
operation: (inout Self) async throws -> Result,
33+
withHandler handler: (Int) async throws -> Void
34+
) async rethrows -> Result {
35+
return try await withoutActuallyEscaping(handler) { escapingHandler in
36+
return try await operation(&self)
37+
}
38+
}
2639
}

0 commit comments

Comments
 (0)