Update comment about leaking
This commit is contained in:
parent
aa83e2aa04
commit
21c2343d3f
@ -192,7 +192,7 @@ use crate::ptr;
|
|||||||
/// unsafe { addr_of_mut!((*ptr).name).write("Bob".to_string()); }
|
/// unsafe { addr_of_mut!((*ptr).name).write("Bob".to_string()); }
|
||||||
///
|
///
|
||||||
/// // Initializing the `list` field
|
/// // Initializing the `list` field
|
||||||
/// // If there was a panic here, then the `String` in the `name` field would be leaked.
|
/// // If there is a panic here, then the `String` in the `name` field leaks.
|
||||||
/// unsafe { addr_of_mut!((*ptr).list).write(vec![0, 1, 2]); }
|
/// unsafe { addr_of_mut!((*ptr).list).write(vec![0, 1, 2]); }
|
||||||
///
|
///
|
||||||
/// // All the fields are initialized, so we call `assume_init` to get an initialized Foo.
|
/// // All the fields are initialized, so we call `assume_init` to get an initialized Foo.
|
||||||
|
Loading…
Reference in New Issue
Block a user