Skip to content

Commit 765a241

Browse files
add missing documentation on Err case
Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
1 parent ca9f572 commit 765a241

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/core/src/init.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ pub unsafe trait Init<T: ?Sized + Pointee> {
7373
/// Writes a valid value of type `T` to `slot` or fails.
7474
///
7575
/// If this call returns [`Ok`], then `slot` is guaranteed to contain a valid
76-
/// value of type `T`. If `T` is unsized, then `slot` may be combined with
76+
/// value of type `T`.
77+
/// Otherwise, in case the result is an [`Err`], the implementation must guarantee
78+
/// that the `slot` may be repurposed for future reuse.
79+
///
80+
/// If `T` is unsized, then `slot` may be combined with
7781
/// the metadata to obtain a valid pointer to the value.
7882
///
7983
/// Note that `slot` should be thought of as a `*mut T`. A unit type is used

0 commit comments

Comments
 (0)