Skip to content

Commit cd74534

Browse files
authored
[Docs] Clarifies ObjectIdentifier guarantees (swiftlang#31472)
[SR-13564](https://bugs.swift.org/browse/SR-13564) rdar://69169351
1 parent 5d30503 commit cd74534

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/core/ObjectIdentifier.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
/// In Swift, only class instances and metatypes have unique identities. There
1616
/// is no notion of identity for structs, enums, functions, or tuples.
1717
@frozen // trivial-implementation
18+
///
19+
/// `ObjectIdentifier` is only guaranteed to remain unique for the
20+
/// lifetime of an object. If an object has a stronger notion of identity, it
21+
/// may be appropriate to provide a custom implementation.
22+
1823
public struct ObjectIdentifier {
1924
@usableFromInline // trivial-implementation
2025
internal let _value: Builtin.RawPointer

0 commit comments

Comments
 (0)