rust/tests/ui/mir/auxiliary/issue_76375_aux.rs

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

21 lines
338 B
Rust
Raw Normal View History

//@ edition:2018
//@ compile-flags: -Z mir-opt-level=3
2020-10-20 03:07:41 -05:00
#[inline(always)]
pub fn copy_prop(s: bool) -> String {
2020-10-20 03:07:41 -05:00
let a = "Hello world!".to_string();
let b = a;
let c = b;
if s {
c
} else {
String::new()
}
}
#[inline(always)]
pub fn dest_prop(x: &[u8]) -> &[u8] {
let y = &x[..x.len()];
y
}