rust/library/alloc
Dylan DPC 9c72f16b9f
Rollup merge of #97229 - Nilstrieb:doc-box-noalias, r=dtolnay
Document the current aliasing rules for `Box<T>`.

Currently, `Box<T>` gets `noalias`, meaning it has the same rules as `&mut T`. This is sparsely documented, even though it can have quite a big impact on unsafe code using box. Therefore, these rules are documented here, with a big warning that they are not normative and subject to change, since we have not yet committed to an aliasing model and the state of `Box<T>` is especially uncertain.

If you have any suggestions and improvements, make sure to leave them here. This is mostly intended to inform people about what is currently going on (to prevent misunderstandings such as [Jon Gjengset's Box aliasing](https://www.youtube.com/watch?v=EY7Wi9fV5bk)).

This is supposed to _only document current UB_ and not add any new guarantees or rules.
2022-05-31 07:57:33 +02:00
..
benches Avoid use of rand::thread_rng in stdlib benchmarks 2022-05-02 00:08:21 -07:00
src Rollup merge of #97229 - Nilstrieb:doc-box-noalias, r=dtolnay 2022-05-31 07:57:33 +02:00
tests Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
Cargo.toml Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00