You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Constructs a new SmallVec on the stack from an A without copying elements. Also sets the length. The user is responsible for ensuring that len <= A::size().
592
+
/// Constructs a new `SmallVec` on the stack from an A without copying elements. Also sets the length. The user is responsible for ensuring that `len <= A::size()`.
/// Creates a SmallVec directly from the raw components of another SmallVec.
1201
+
/// Creates a `SmallVec` directly from the raw components of another `SmallVec`.
1202
1202
///
1203
1203
/// # Safety
1204
1204
///
1205
1205
/// This is highly unsafe, due to the number of invariants that aren’t checked:
1206
1206
///
1207
-
/// - ptr needs to have been previously allocated via SmallVec from its spilled storage (at least, it’s highly likely to be incorrect if it wasn’t).
1208
-
/// - ptr’s A::Item type needs to be the same size and alignment that it was allocated with
1209
-
/// - length needs to be less than or equal to capacity.
1210
-
/// - capacity needs to be the capacity that the pointer was allocated with.
1207
+
/// - `ptr` needs to have been previously allocated via `SmallVec` from its spilled storage (at least, it’s highly likely to be incorrect if it wasn’t).
1208
+
/// - `ptr`’s `A::Item` type needs to be the same size and alignment that it was allocated with
1209
+
/// - `length` needs to be less than or equal to `capacity`.
1210
+
/// - `capacity` needs to be the capacity that the pointer was allocated with.
1211
1211
///
1212
1212
/// Violating these may cause problems like corrupting the allocator’s internal data structures.
1213
1213
///
1214
-
/// Additionally, capacity must be greater than the amount of inline storage A has; that is, the new SmallVec must need to spill over into heap allocated storage. This condition is asserted against.
1214
+
/// Additionally, `capacity` must be greater than the amount of inline storage `A` has; that is, the new `SmallVec` must need to spill over into heap allocated storage. This condition is asserted against.
1215
1215
///
1216
-
/// The ownership of ptr is effectively transferred to the SmallVec which may then deallocate, reallocate or change the contents of memory pointed to by the pointer at will. Ensure that nothing else uses the pointer after calling this function.
1216
+
/// The ownership of `ptr` is effectively transferred to the `SmallVec` which may then deallocate, reallocate or change the contents of memory pointed to by the pointer at will. Ensure that nothing else uses the pointer after calling this function.
0 commit comments