Skip to content

Commit 0deaf7c

Browse files
committed
Add missing definitions for dynamic sized types and fat pointer types
1 parent 9772235 commit 0deaf7c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/glossary.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,8 +2278,7 @@ fat pointer type
22782278
^^^^^^^^^^^^^^^^
22792279

22802280
:dp:`fls_l8ew6udd79hh`
2281-
A :dt:`fat pointer type` is an :t:`indirection type` that refers to a
2282-
:t:`dynamically sized type`.
2281+
A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`.
22832282

22842283
.. _fls_qi21fdknzez6:
22852284

src/types-and-traits.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,12 @@ Type Layout
13731373
:dp:`fls_kdbq02iguzgl`
13741374
All :t:`[value]s` have an :t:`alignment` and a :t:`size`.
13751375

1376+
:dp:`fls_26Xgem831Nqg`
1377+
A :dt:`dynamically sized type` is a :t:`type` that does not implement the :std:`core::marker::Sized` :t:`trait`.
1378+
1379+
:dp:`fls_ozYgHEHFTT5c`
1380+
A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`.
1381+
13761382
:dp:`fls_muxfn9soi47l`
13771383
The :t:`alignment` of a :t:`value` specifies which addresses are valid for
13781384
storing the :t:`value`. :t:`Alignment` is measured in bytes, is at least one,
@@ -1453,8 +1459,9 @@ For a :t:`function pointer type`, the :t:`size` and :t:`alignment` are those of
14531459
a :t:`thin pointer`.
14541460

14551461
:dp:`fls_e5hivr6m5s3h`
1456-
For a :t:`fat pointer`, the :t:`size` and :t:`alignment` are tool-defined, but
1462+
For a :t:`fat pointer type`, the :t:`size` and :t:`alignment` are tool-defined, but
14571463
are at least those of a :t:`thin pointer`.
1464+
For a :t:`fat pointer type` whose contained :t:`type` is that of a :t:`slice` or :t:`trait object type` the :t:`size` is that of two times the size of :t:`type` :c:`usize` and the :t:`alignment` is that of :t:`type` :c:`usize`.
14581465

14591466
:dp:`fls_hlbsjggfxnt2`
14601467
For a :t:`trait object type`, the :t:`layout` is the same as the :t:`value`

0 commit comments

Comments
 (0)