diff options
| author | bors <bors@rust-lang.org> | 2019-12-01 06:00:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-12-01 06:00:33 +0000 |
| commit | 4007d4ef26eab44bdabc2b7574d032152264d3ad (patch) | |
| tree | feada823fc5b16040da2f7aba36cda434f0b2fa4 /src/liballoc/raw_vec | |
| parent | 135ccbaca86ed4b9c0efaf0cd31442eae57ffad7 (diff) | |
| parent | bed4c09d21aceb440ee61091b68dd653da32b45b (diff) | |
| download | rust-4007d4ef26eab44bdabc2b7574d032152264d3ad.tar.gz rust-4007d4ef26eab44bdabc2b7574d032152264d3ad.zip | |
Auto merge of #66917 - Centril:rollup-xj2enik, r=Centril
Rollup of 9 pull requests Successful merges: - #66503 (More useful test error messages on should_panic(expected=...) mismatch) - #66662 (Miri: run panic-catching tests in liballoc) - #66679 (Improve lifetime errors with implicit trait object lifetimes) - #66726 (Use recursion_limit for const eval stack limit) - #66790 (Do `min_const_fn` checks for `SetDiscriminant`s target) - #66832 (const_prop: detect and avoid catching Miri errors that require allocation) - #66880 (Add long error code explanation message for E0203) - #66890 (Format liballoc with rustfmt) - #66896 (pass Queries to compiler callbacks) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc/raw_vec')
| -rw-r--r-- | src/liballoc/raw_vec/tests.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/liballoc/raw_vec/tests.rs b/src/liballoc/raw_vec/tests.rs index d35b62fc1ef..b214cef3011 100644 --- a/src/liballoc/raw_vec/tests.rs +++ b/src/liballoc/raw_vec/tests.rs @@ -16,7 +16,9 @@ fn allocator_param() { // A dumb allocator that consumes a fixed amount of fuel // before allocation attempts start failing. - struct BoundedAlloc { fuel: usize } + struct BoundedAlloc { + fuel: usize, + } unsafe impl Alloc for BoundedAlloc { unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> { let size = layout.size(); @@ -24,7 +26,10 @@ fn allocator_param() { return Err(AllocErr); } match Global.alloc(layout) { - ok @ Ok(_) => { self.fuel -= size; ok } + ok @ Ok(_) => { + self.fuel -= size; + ok + } err @ Err(_) => err, } } |
