]> git.lizzy.rs Git - rust.git/blob - tests/codegen/vecdeque_no_panic.rs
Rollup merge of #107731 - RalfJung:interpret-discriminant, r=cjgillot
[rust.git] / tests / codegen / vecdeque_no_panic.rs
1 // This test checks that `VecDeque::front[_mut]()` and `VecDeque::back[_mut]()` can't panic.
2
3 // compile-flags: -O
4 // ignore-debug: the debug assertions get in the way
5
6 #![crate_type = "lib"]
7
8 use std::collections::VecDeque;
9
10 // CHECK-LABEL: @dont_panic
11 #[no_mangle]
12 pub fn dont_panic(v: &mut VecDeque<usize>) {
13     // CHECK-NOT: expect
14     // CHECK-NOT: panic
15     v.front();
16     v.front_mut();
17     v.back();
18     v.back_mut();
19 }