]> git.proxmox.com Git - rustc.git/blame - src/test/codegen/issue-27130.rs
New upstream version 1.58.1+dfsg1
[rustc.git] / src / test / codegen / issue-27130.rs
CommitLineData
1b1a35ee 1// compile-flags: -O
1b1a35ee
XL
2
3#![crate_type = "lib"]
4
5// CHECK-LABEL: @trim_in_place
6#[no_mangle]
7pub fn trim_in_place(a: &mut &[u8]) {
8 while a.first() == Some(&42) {
9 // CHECK-NOT: slice_index_order_fail
10 *a = &a[1..];
11 }
12}
13
14// CHECK-LABEL: @trim_in_place2
15#[no_mangle]
16pub fn trim_in_place2(a: &mut &[u8]) {
17 while let Some(&42) = a.first() {
18 // CHECK-NOT: slice_index_order_fail
19 *a = &a[2..];
20 }
21}