Skip to content

Commit 0494db0

Browse files
committed
---
yaml --- r: 229037 b: refs/heads/try c: 5f02de3 h: refs/heads/master i: 229035: 3a58a27 v: v3
1 parent 6d4c138 commit 0494db0

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 14bc45477085222dcf2b87bef75ca3e7d0b5274a
4+
refs/heads/try: 5f02de3c226bce60c58ce2bc436e69c55b90a616
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/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/try/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)