We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 61fb909 + 5052197 commit 986e49dCopy full SHA for 986e49d
src/liballoc/vec.rs
@@ -816,6 +816,9 @@ impl<T> Vec<T> {
816
/// let mut vec = vec![vec![1, 0, 0],
817
/// vec![0, 1, 0],
818
/// vec![0, 0, 1]];
819
+ /// // SAFETY:
820
+ /// // 1. `old_len..0` is empty so no elements need to be initialized.
821
+ /// // 2. `0 <= capacity` always holds whatever `capacity` is.
822
/// unsafe {
823
/// vec.set_len(0);
824
/// }
0 commit comments