diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 30bcc034221d3..0da00b70f9e51 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -816,6 +816,9 @@ impl Vec { /// let mut vec = vec![vec![1, 0, 0], /// vec![0, 1, 0], /// vec![0, 0, 1]]; + /// // SAFETY: + /// // 1. `old_len..0` is empty so no elements need to be initialized. + /// // 2. `0 <= capacity` always holds whatever `capacity` is. /// unsafe { /// vec.set_len(0); /// }