rust/tests/codegen/vecdeque_no_panic.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
422 B
Rust
Raw Normal View History

// This test checks that `VecDeque::front[_mut]()` and `VecDeque::back[_mut]()` can't panic.
//@ compile-flags: -O
2024-02-23 17:04:01 -06:00
//@ ignore-debug: plain old debug assertions
#![crate_type = "lib"]
use std::collections::VecDeque;
// CHECK-LABEL: @dont_panic
#[no_mangle]
pub fn dont_panic(v: &mut VecDeque<usize>) {
// CHECK-NOT: expect
// CHECK-NOT: panic
v.front();
v.front_mut();
v.back();
v.back_mut();
}