Skip to content

Commit 08d8804

Browse files
committed
[SE-0206][stdlib] Clarify Hasher.finalize() documentation
1 parent 97ec296 commit 08d8804

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/public/core/Hasher.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,11 @@ public struct Hasher {
359359
return Int(truncatingIfNeeded: _core.finalize())
360360
}
361361

362-
/// Finalize the hasher state and return the hash value. Finalizing consumes
363-
/// the hasher, forbidding further operations.
362+
/// Finalize the hasher state and return the hash value.
363+
///
364+
/// Finalizing consumes the hasher: it is illegal to finalize a hasher you
365+
/// don't own, or to perform operations on a finalized hasher. (These may
366+
/// become compile-time errors in the future.)
364367
@effects(releasenone)
365368
public __consuming func finalize() -> Int {
366369
var core = _core

0 commit comments

Comments
 (0)