rust/tests
bors cca3373706 Auto merge of #113113 - Amanieu:box-vec-zst, r=Mark-Simulacrum
Eliminate ZST allocations in `Box` and `Vec`

This PR fixes 2 issues with `Box` and `RawVec` related to ZST allocations. Specifically, the `Allocator` trait requires that:
- If you allocate a zero-sized layout then you must later deallocate it, otherwise the allocator may leak memory.
- You cannot pass a ZST pointer to the allocator that you haven't previously allocated.

These restrictions exist because an allocator implementation is allowed to allocate non-zero amounts of memory for a zero-sized allocation. For example, `malloc` in libc does this.

Currently, ZSTs are handled differently in `Box` and `Vec`:
- `Vec` never allocates when `T` is a ZST or if the vector capacity is 0.
- `Box` just blindly passes everything on to the allocator, including ZSTs.

This causes problems due to the free conversions between `Box<[T]>` and `Vec<T>`, specifically that ZST allocations could get leaked or a dangling pointer could be passed to `deallocate`.

This PR fixes this by changing `Box` to not allocate for zero-sized values and slices. It also fixes a bug in `RawVec::shrink` where shrinking to a size of zero did not actually free the backing memory.
2023-07-14 01:59:08 +00:00
..
assembly test-various: run codegen and assembly tests 2023-07-02 02:22:22 +02:00
auxiliary
codegen Reenable all cases of simd-wide-sum 2023-07-11 20:21:32 -07:00
codegen-units
debuginfo
incremental
mir-opt Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, r=cjgillot 2023-07-08 20:53:29 +02:00
pretty
run-coverage Re-enable some coverage tests on Linux 2023-07-06 10:19:31 +10:00
run-coverage-rustdoc Re-bless the newly-migrated tests 2023-06-28 11:09:19 +10:00
run-make Rollup merge of #113247 - mirkootter:test-wasm-exceptions-nostd, r=Mark-Simulacrum 2023-07-09 16:33:36 +02:00
run-make-fulldeps Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
run-pass-valgrind
rustdoc Update jump to def tests 2023-07-12 16:50:43 +02:00
rustdoc-gui Update jump to def tests 2023-07-12 16:50:43 +02:00
rustdoc-js Auto merge of #112233 - notriddle:notriddle/search-unify, r=GuillaumeGomez 2023-06-15 03:04:46 +00:00
rustdoc-js-std Auto merge of #108537 - GuillaumeGomez:rustdoc-search-whitespace-as-separator, r=notriddle 2023-07-02 18:49:29 +00:00
rustdoc-json
rustdoc-ui
ui Auto merge of #113113 - Amanieu:box-vec-zst, r=Mark-Simulacrum 2023-07-14 01:59:08 +00:00
ui-fulldeps Rollup merge of #113373 - jyn514:download-rustc-fixes, r=albertlarsan68 2023-07-11 21:00:27 -07:00
COMPILER_TESTS.md