Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing definitions for dynamic sized types and fat pointer types #527

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2278,8 +2278,7 @@ fat pointer type
^^^^^^^^^^^^^^^^

:dp:`fls_l8ew6udd79hh`
A :dt:`fat pointer type` is an :t:`indirection type` that refers to a
:t:`dynamically sized type`.
A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`.
Comment on lines -2282 to +2281
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it right that the same text is here and in src/types-and-traits.rst?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the glossary tends to just duplicate the definition in the actual files


.. _fls_qi21fdknzez6:

Expand Down
9 changes: 8 additions & 1 deletion src/types-and-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,12 @@ Type Layout
:dp:`fls_kdbq02iguzgl`
All :t:`[value]s` have an :t:`alignment` and a :t:`size`.

:dp:`fls_26Xgem831Nqg`
A :dt:`dynamically sized type` is a :t:`type` that does not implement the :std:`core::marker::Sized` :t:`trait`.

:dp:`fls_ozYgHEHFTT5c`
A :dt:`fat pointer type` is an :t:`indirection type` whose contained :t:`type specification` is a :t:`dynamically sized type`.

:dp:`fls_muxfn9soi47l`
The :t:`alignment` of a :t:`value` specifies which addresses are valid for
storing the :t:`value`. :t:`Alignment` is measured in bytes, is at least one,
Expand Down Expand Up @@ -1453,8 +1459,9 @@ For a :t:`function pointer type`, the :t:`size` and :t:`alignment` are those of
a :t:`thin pointer`.

:dp:`fls_e5hivr6m5s3h`
For a :t:`fat pointer`, the :t:`size` and :t:`alignment` are tool-defined, but
For a :t:`fat pointer type`, the :t:`size` and :t:`alignment` are tool-defined, but
are at least those of a :t:`thin pointer`.
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`.

:dp:`fls_hlbsjggfxnt2`
For a :t:`trait object type`, the :t:`layout` is the same as the :t:`value`
Expand Down
Loading