Skip to content

Commit 41b527a

Browse files
committed
---
yaml --- r: 236108 b: refs/heads/stable c: 5f02de3 h: refs/heads/master v: v3
1 parent 41eee3b commit 41b527a

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 14bc45477085222dcf2b87bef75ca3e7d0b5274a
32+
refs/heads/stable: 5f02de3c226bce60c58ce2bc436e69c55b90a616
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/doc/tarpl/casts.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ using the `as` keyword: `expr as Type`.
99
True casts generally revolve around raw pointers and the primitive numeric
1010
types. Even though they're dangerous, these casts are *infallible* at runtime.
1111
If a cast triggers some subtle corner case no indication will be given that
12-
this occurred. The cast will simply succeed.
12+
this occurred. The cast will simply succeed. That said, casts must be valid
13+
at the type level, or else they will be prevented statically. For instance,
14+
`7u8 as bool` will not compile.
1315

1416
That said, casts aren't `unsafe` because they generally can't violate memory
1517
safety *on their own*. For instance, converting an integer to a raw pointer can

branches/stable/src/doc/tarpl/repr-rust.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ An enum is said to be *C-like* if none of its variants have associated data.
1212
For all these, individual fields are aligned to their preferred alignment. For
1313
primitives this is usually equal to their size. For instance, a u32 will be
1414
aligned to a multiple of 32 bits, and a u16 will be aligned to a multiple of 16
15-
bits. Composite structures will have a preferred alignment equal to the maximum
15+
bits. Note that some primitives may be emulated on different platforms, and as
16+
such may have strange alignment. For instance, a u64 on x86 may actually be
17+
emulated as a pair of u32s, and thus only have 32-bit alignment.
18+
19+
Composite structures will have a preferred alignment equal to the maximum
1620
of their fields' preferred alignment, and a size equal to a multiple of their
1721
preferred alignment. This ensures that arrays of T can be correctly iterated
1822
by offsetting by their size. So for instance,

0 commit comments

Comments
 (0)