diff options
| author | EFanZh <efanzh@gmail.com> | 2024-10-03 22:15:52 +0800 |
|---|---|---|
| committer | EFanZh <efanzh@gmail.com> | 2024-10-03 22:15:52 +0800 |
| commit | d47e388843f682f57262f020edd9909c850a0c49 (patch) | |
| tree | 9e026e331e81a76b6586d63eb064ab9ddcd43d5b /tests/codegen | |
| parent | 9c7013c15c189a6978ac8b9dac638581495527de (diff) | |
| download | rust-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.rs | 13 |
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) +} |
