From 1fe0faaf07304a392e2feb9bbb54edae649d0288 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 30 Oct 2024 06:21:38 -0700 Subject: [PATCH 1/2] Fix header link for The Rust Representation --- src/type-layout.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/type-layout.md b/src/type-layout.md index f16ac6d88..c31510e5c 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -207,7 +207,8 @@ not change the layout of the fields themselves. For example, a struct with a `C` representation that contains a struct `Inner` with the default representation will not change the layout of `Inner`. -### The `Rust` Representation + +### The `Rust` Representation r[layout.repr.rust] From 1317a7540394c557b10f129df20c8987f33dd89a Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 30 Oct 2024 06:27:48 -0700 Subject: [PATCH 2/2] Further remove the "default" representation This updates some more references to the "default" representation and instead refers to it directly as the "Rust" representation. This is intended to more consistently refer to the same concept. --- src/items/enumerations.md | 4 ++-- src/type-layout.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/items/enumerations.md b/src/items/enumerations.md index f20c77d72..02b2b8373 100644 --- a/src/items/enumerations.md +++ b/src/items/enumerations.md @@ -133,7 +133,7 @@ Each enum instance has a _discriminant_: an integer logically associated to it that is used to determine which variant it holds. r[items.enum.discriminant.repr-rust] -Under the [default representation], the discriminant is interpreted as +Under the [`Rust` representation], the discriminant is interpreted as an `isize` value. However, the compiler is allowed to use a smaller type (or another means of distinguishing variants) in its actual memory layout. @@ -378,7 +378,6 @@ enum E { [`C` representation]: ../type-layout.md#the-c-representation [call expression]: ../expressions/call-expr.md [constant expression]: ../const_eval.md#constant-expressions -[default representation]: ../type-layout.md#the-default-representation [enumerated type]: ../types/enum.md [Field-less enums]: #field-less-enum [IDENTIFIER]: ../identifiers.md @@ -386,6 +385,7 @@ enum E { [numeric cast]: ../expressions/operator-expr.md#semantics [path expression]: ../expressions/path-expr.md [primitive representation]: ../type-layout.md#primitive-representations +[`Rust` representation]: ../type-layout.md#the-rust-representation [struct expression]: ../expressions/struct-expr.md [struct]: structs.md [type namespace]: ../names/namespaces.md diff --git a/src/type-layout.md b/src/type-layout.md index c31510e5c..5d04d2a80 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -204,7 +204,7 @@ struct AlignedStruct { r[layout.repr.inter-field] The representation of a type can change the padding between fields, but does not change the layout of the fields themselves. For example, a struct with a -`C` representation that contains a struct `Inner` with the default +`C` representation that contains a struct `Inner` with the `Rust` representation will not change the layout of `Inner`.