about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorEFanZh <efanzh@gmail.com>2024-10-03 22:15:52 +0800
committerEFanZh <efanzh@gmail.com>2024-10-03 22:15:52 +0800
commitd47e388843f682f57262f020edd9909c850a0c49 (patch)
tree9e026e331e81a76b6586d63eb064ab9ddcd43d5b /tests/codegen
parent9c7013c15c189a6978ac8b9dac638581495527de (diff)
downloadrust-d47e388843f682f57262f020edd9909c850a0c49.tar.gz
rust-d47e388843f682f57262f020edd9909c850a0c49.zip
Avoid emptiness check in `PeekMut::pop`
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/binary-heap-peek-mut-pop-no-panic.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/codegen/binary-heap-peek-mut-pop-no-panic.rs b/tests/codegen/binary-heap-peek-mut-pop-no-panic.rs
new file mode 100644
index 00000000000..9cf4f210e52
--- /dev/null
+++ b/tests/codegen/binary-heap-peek-mut-pop-no-panic.rs
@@ -0,0 +1,13 @@
+//@ compile-flags: -O
+//@ ignore-debug
+#![crate_type = "lib"]
+
+use std::collections::binary_heap::PeekMut;
+
+// CHECK-LABEL: @peek_mut_pop
+#[no_mangle]
+pub fn peek_mut_pop(peek_mut: PeekMut<u32>) -> u32 {
+    // CHECK-NOT: panic
+    // CHECK-NOT: unwrap_failed
+    PeekMut::pop(peek_mut)
+}