about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-27 18:36:32 +0000
committerbors <bors@rust-lang.org>2021-01-27 18:36:32 +0000
commita2f8f6281817d430e20726128b739d3c6708561c (patch)
tree28024be6199a7cc05e20fb034e4dfa94f62632f5 /src
parent613ef740f3f37702728c6324f948d0abd1e9c82b (diff)
parentd069c58e78891d453b0b17adfecd368694fd289f (diff)
downloadrust-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.rs8
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);
-}