Skip to content

Commit 7d41c95

Browse files
committed
fix data headers
1 parent cb4f081 commit 7d41c95

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

data.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Low-level programming cares a lot about data layout. It's a big deal. It also pe
44
influences the rest of the language, so we're going to start by digging into how data is
55
represented in Rust.
66

7-
# The `rust` repr
7+
## The rust repr
88

99
Rust gives you the following ways to lay out composite data:
1010

@@ -124,7 +124,7 @@ In principle enums can use fairly elaborate algorithms to cache bits throughout
124124
with special constrained representations. As such it is *especially* desirable that we leave
125125
enum layout unspecified today.
126126

127-
# Dynamically Sized Types (DSTs)
127+
## Dynamically Sized Types (DSTs)
128128

129129
Rust also supports types without a statically known size. On the surface,
130130
this is a bit nonsensical: Rust must know the size of something in order to
@@ -212,12 +212,12 @@ struct Foo {
212212
For details as to *why* this is done, and how to make it not happen, check out
213213
[SOME OTHER SECTION].
214214

215-
# Alternative representations
215+
## Alternative representations
216216

217217
Rust allows you to specify alternative data layout strategies from the default Rust
218218
one.
219219

220-
# repr(C)
220+
### repr(C)
221221

222222
This is the most important `repr`. It has fairly simple intent: do what C does.
223223
The order, size, and alignment of fields is exactly what you would expect from
@@ -241,14 +241,14 @@ still consumes a byte of space.
241241

242242
* This is equivalent to repr(u32) for enums (see below)
243243

244-
# repr(packed)
244+
### repr(packed)
245245

246246
`repr(packed)` forces rust to strip any padding it would normally apply.
247247
This may improve the memory footprint of a type, but will have negative
248248
side-effects from "field access is heavily penalized" to "completely breaks
249249
everything" based on target platform.
250250

251-
# repr(u8), repr(u16), repr(u32), repr(u64)
251+
### repr(u8), repr(u16), repr(u32), repr(u64)
252252

253253
These specify the size to make a c-like enum (one which has no values in its variants).
254254

0 commit comments

Comments
 (0)