Skip to content

Commit f6f674f

Browse files
authored
Merge pull request rust-lang#2289 from rust-lang/TC/document-metadata-of-pointers-to-indirectly-sized-types
Document metadata of ptrs to indirectly unsized types
2 parents fca9d52 + ab30b8a commit f6f674f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/dynamically-sized-types.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ r[dynamic-sized.pointer-types]
1111
* [Pointer types] to <abbr title="dynamically sized types">DSTs</abbr> are sized but have twice the size of pointers to sized types, since they also store *metadata*:
1212
* Pointers to slices store the number of elements; pointers to `str` store the length in bytes.
1313
* Pointers to trait objects store a pointer to a vtable.
14+
* Pointers to a struct or tuple with an [unsized tail] store the same metadata as a pointer to that tail.
1415

1516
r[dynamic-sized.question-sized]
1617
* <abbr title="dynamically sized types">DSTs</abbr> can be provided as type arguments to generic type parameters having the special `?Sized` bound. They can also be used for associated type definitions when the corresponding associated type declaration has a `?Sized` bound. By default, any type parameter or associated type has a `Sized` bound, unless it is relaxed using `?Sized`.
@@ -30,6 +31,7 @@ The *unsized tail* of a type is the dynamically sized component that the [metada
3031

3132
[metadata]: dynamic-sized.pointer-types
3233
[sized]: special-types-and-traits.md#sized
34+
[unsized tail]: dynamic-sized.tail
3335
[Slices]: types/slice.md
3436
[slice]: types/slice.md
3537
[str]: types/str.md

0 commit comments

Comments
 (0)