diff options
| author | bors <bors@rust-lang.org> | 2021-01-27 18:36:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-27 18:36:32 +0000 |
| commit | a2f8f6281817d430e20726128b739d3c6708561c (patch) | |
| tree | 28024be6199a7cc05e20fb034e4dfa94f62632f5 /src | |
| parent | 613ef740f3f37702728c6324f948d0abd1e9c82b (diff) | |
| parent | d069c58e78891d453b0b17adfecd368694fd289f (diff) | |
| download | rust-a2f8f6281817d430e20726128b739d3c6708561c.tar.gz rust-a2f8f6281817d430e20726128b739d3c6708561c.zip | |
Auto merge of #81335 - thomwiggers:no-panic-shrink-to, r=Mark-Simulacrum
Trying to shrink_to greater than capacity should be no-op Per the discussion in https://github.com/rust-lang/rust/issues/56431, `shrink_to` shouldn't panic if you try to make a vector shrink to a capacity greater than its current capacity.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/codegen/vec-shrink-panic.rs | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/test/codegen/vec-shrink-panic.rs b/src/test/codegen/vec-shrink-panic.rs index cee4128c650..6b0ac78857a 100644 --- a/src/test/codegen/vec-shrink-panic.rs +++ b/src/test/codegen/vec-shrink-panic.rs @@ -26,11 +26,3 @@ pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> { // CHECK-NOT: panic iter.iter().copied().collect() } - -// Sanity-check that we do see a possible panic for an arbitrary `Vec::shrink_to`. -// CHECK-LABEL: @shrink_to -#[no_mangle] -pub fn shrink_to(vec: &mut Vec<u32>) { - // CHECK: panic - vec.shrink_to(42); -} |
