Commit a4fc9c4
committed
Improve the documentation around layout gurantees given by
This change extends the memory layout section in the documentation of `Box`
to explicitly state that it is sound to convert between `Box<A>` and
`Box<B>` as long as a cast between `*mut A` and `*mut B` is valid and
the general requirements of `transmute` are satisfied.
See
https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Is.20transmuting.20between.20.60Box.3CA.3E.60.20and.20.60Box.3CB.3E.60.20UB.3F/with/585350243
for the relevant discussion.Box
1 parent 3179a47 commit a4fc9c4
1 file changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
124 | 143 | | |
125 | 144 | | |
126 | 145 | | |
| |||
180 | 199 | | |
181 | 200 | | |
182 | 201 | | |
| 202 | + | |
183 | 203 | | |
184 | 204 | | |
185 | 205 | | |
| |||
0 commit comments