rust/src/test
Yuki Okushi 9bc003da11
Rollup merge of #69026 - TimDiekmann:common-usage, r=Amanieu
Remove common usage pattern from `AllocRef`

This removes the common usage patterns from `AllocRef`:
- `alloc_one`
- `dealloc_one`
- `alloc_array`
- `realloc_array`
- `dealloc_array`

Actually, they add nothing to `AllocRef` except a [convenience wrapper around `Layout` and other methods in this trait](https://doc.rust-lang.org/1.41.0/src/core/alloc.rs.html#1076-1240) but have a major flaw: The documentation of `AllocRefs` notes, that

> some higher-level allocation methods (`alloc_one`, `alloc_array`) are well-defined on zero-sized types and can optionally support them: it is left up to the implementor whether to return `Err`, or to return `Ok` with some pointer.

With the current API, `GlobalAlloc` does not have those methods, so they cannot be overridden for `liballoc::Global`, which means that even if the global allocator would support zero-sized allocations, `alloc_one`, `alloc_array`, and `realloc_array` for `liballoc::Global` will error, while calling `alloc` with a zeroed-size `Layout` could succeed. Even worse: allocating with `alloc` and deallocating with `dealloc_{one,array}` could end up with not calling `dealloc` at all!

For the full discussion please see https://github.com/rust-lang/wg-allocators/issues/18

r? @Amanieu
2020-02-12 18:55:44 +09:00
..
assembly
auxiliary Auto merge of #68452 - msizanoen1:riscv-abi, r=nagisa,eddyb 2020-02-08 18:10:48 +00:00
codegen Auto merge of #68961 - eddyb:dbg-stack-dunk, r=nagisa 2020-02-11 07:36:59 +00:00
codegen-units Make drop-glue take advantage of -Zshare-generics. 2020-01-23 13:15:15 +01:00
compile-fail Diagnostics should not end with a full stop 2020-01-12 15:37:50 +00:00
debuginfo rustc_codegen_ssa: only "spill" SSA-like values to the stack for debuginfo. 2020-02-09 16:39:23 +02:00
incremental Move the krate method to Hir and remove the Krate dep node 2020-02-06 13:23:32 +01:00
mir-opt Rollup merge of #68524 - jonas-schievink:generator-resume-arguments, r=Zoxc 2020-02-06 22:38:33 +01:00
pretty add regression test 2020-02-07 18:18:07 +03:00
run-fail Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
run-make Auto merge of #67878 - Others:opt-3, r=Mark-Simulacrum 2020-01-31 00:03:55 +00:00
run-make-fulldeps test: use all: $(call NATIVE_STATICLIB,test) to build a C lib. 2020-02-08 13:40:50 +02:00
run-pass-valgrind
rustdoc Auto merge of #68325 - faern:move-numeric-consts-to-associated-consts-step1, r=LukasKalbertodt 2020-01-30 08:55:07 +00:00
rustdoc-js
rustdoc-js-std
rustdoc-ui --bless --compare-mode=nll 2020-02-09 20:43:49 +01:00
rustfix
ui Rollup merge of #69026 - TimDiekmann:common-usage, r=Amanieu 2020-02-12 18:55:44 +09:00
ui-fulldeps Fix stage2 test failures from call to span_lint. 2020-02-11 19:50:26 +10:00
COMPILER_TESTS.md