Skip to content

Commit e4f4bd3

Browse files
authored
Merge pull request swiftlang#81592 from tshortli/embedded-swift-retain-discardable-result
Embedded: Suppress spurious unused result warnings
2 parents 6eacd23 + f8fb993 commit e4f4bd3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/core/EmbeddedRuntime.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ func swift_isUniquelyReferenced_nonNull_native(object: UnsafeMutablePointer<Heap
316316
}
317317

318318
@_cdecl("swift_retain")
319+
@discardableResult
319320
public func swift_retain(object: Builtin.RawPointer) -> Builtin.RawPointer {
320321
if !isValidPointerForNativeRetain(object: object) { return object }
321322

@@ -344,6 +345,7 @@ func swift_retain_n_(object: UnsafeMutablePointer<HeapObject>, n: UInt32) -> Uns
344345
}
345346

346347
@_cdecl("swift_bridgeObjectRetain")
348+
@discardableResult
347349
public func swift_bridgeObjectRetain(object: Builtin.RawPointer) -> Builtin.RawPointer {
348350
return swift_bridgeObjectRetain_n(object: object, n: 1)
349351
}

0 commit comments

Comments
 (0)