File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -172,10 +172,10 @@ of UB.
172
172
There is [ an accepted RFC] [ extern-types ] to add proper types with an unknown size,
173
173
called * extern types* , which would let Rust developers model things like C's ` void* `
174
174
and other "declared but never defined" types more accurately. However as of
175
- Rust 2018, the feature is stuck in limbo over how ` size_of ::<MyExternType>()`
176
- should behave.
175
+ Rust 2018, [ the feature is stuck in limbo over how ` size_of_val ::<MyExternType>()`
176
+ should behave] [ extern-types-issue ] .
177
177
178
- [ dst-issue ] : https://github.com/rust-lang/rust/issues/26403
179
178
[ extern-types ] : https://github.com/rust-lang/rfcs/blob/master/text/1861-extern-types.md
179
+ [ extern-types-issue ] : https://github.com/rust-lang/rust/issues/43467
180
180
[ `str` ] : ../std/primitive.str.html
181
181
[ slice ] : ../std/primitive.slice.html
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ reinterpreting values as a different type.
15
15
We strongly recommend using [ rust-bindgen] [ ] and/or [ cbindgen] [ ] to manage your FFI
16
16
boundaries for you. The Rust team works closely with those projects to ensure
17
17
that they work robustly and are compatible with current and future guarantees
18
- about type layouts and reprs .
18
+ about type layouts and ` repr ` s .
19
19
20
20
The interaction of ` repr(C) ` with Rust's more exotic data layout features must be
21
21
kept in mind. Due to its dual purpose as "for FFI" and "for layout control",
@@ -92,7 +92,7 @@ manipulate its tag and fields. See [the RFC][really-tagged] for details.
92
92
Adding an explicit ` repr ` to an enum suppresses the null-pointer
93
93
optimization.
94
94
95
- These reprs have no effect on a struct.
95
+ These ` repr ` s have no effect on a struct.
96
96
97
97
## repr(packed)
98
98
@@ -107,7 +107,8 @@ compiler might be able to paper over alignment issues with shifts and masks.
107
107
However if you take a reference to a packed field, it's unlikely that the
108
108
compiler will be able to emit code to avoid an unaligned load.
109
109
110
- ** [ As of Rust 2018, this still can cause undefined behavior.] [ ub loads ] **
110
+ [ As this can cause undefined behavior] [ ub loads ] , the lint has been implemented
111
+ and it will become a hard error.
111
112
112
113
` repr(packed) ` is not to be used lightly. Unless you have extreme requirements,
113
114
this should not be used.
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ also cannot use `&mut base_ptr.field` as that would be creating a
137
137
reference. Thus, it is currently not possible to create a raw pointer to a field
138
138
of a partially initialized struct, and also not possible to initialize a single
139
139
field of a partially initialized struct. (a
140
- [ solution to this problem] ( https://github.com/rust-lang/rfcs/pull/2582 ) is being
140
+ [ solution to this problem] ( https://github.com/rust-lang/rust/issues/64490 ) is being
141
141
worked on).
142
142
143
143
One last remark: when reading old Rust code, you might stumble upon the
You can’t perform that action at this time.
0 commit comments