size_of_val_raw: for length 0 this is safe to call
This commit is contained in:
@@ -183,6 +183,8 @@ impl Layout {
|
||||
/// - a [slice], then the length of the slice tail must be an initialized
|
||||
/// integer, and the size of the *entire value*
|
||||
/// (dynamic tail length + statically sized prefix) must fit in `isize`.
|
||||
/// For the special case where the dynamic tail length is 0, this function
|
||||
/// is safe to call.
|
||||
/// - a [trait object], then the vtable part of the pointer must point
|
||||
/// to a valid vtable for the type `T` acquired by an unsizing coercion,
|
||||
/// and the size of the *entire value*
|
||||
|
||||
Reference in New Issue
Block a user