2021-01-09 03:22:06 -06:00
|
|
|
// This test checks that `VecDeque::front[_mut]()` and `VecDeque::back[_mut]()` can't panic.
|
|
|
|
|
2024-02-22 06:10:29 -06:00
|
|
|
//@ compile-flags: -O
|
2024-02-23 17:04:01 -06:00
|
|
|
//@ ignore-debug: plain old debug assertions
|
2021-01-09 03:22:06 -06:00
|
|
|
|
|
|
|
#![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();
|
|
|
|
}
|