Skip to content

Commit fb53df7

Browse files
committed
Move the generic repr note to the intro
I can't really think of a good place to put this, but it didn't really fit with the rule it currently was in.
1 parent 7eb2df6 commit fb53df7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/type-layout.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ The *`repr` [attribute][attributes]* can change the representation and layout of
135135
> }
136136
> ```
137137
138+
> [!NOTE]
139+
> As a consequence of the representation being an attribute on the item, the representation does not depend on generic parameters. Any two types with the same name have the same representation. For example, `Foo<Bar>` and `Foo<Baz>` both have the same representation.
140+
138141
r[layout.repr.align-packed]
139142
The alignment may be raised or lowered with the `align` and `packed` modifiers respectively. They alter the representation specified in the attribute. If no representation is specified, the default one is altered.
140143
@@ -156,9 +159,6 @@ struct AlignedStruct {
156159
}
157160
```
158161
159-
> [!NOTE]
160-
> As a consequence of the representation being an attribute on the item, the representation does not depend on generic parameters. Any two types with the same name have the same representation. For example, `Foo<Bar>` and `Foo<Baz>` both have the same representation.
161-
162162
r[layout.repr.inter-field]
163163
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 `Rust` representation will not change the layout of `Inner`.
164164

0 commit comments

Comments
 (0)