summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/auxiliary/issue_76375_aux.rs
blob: 90f4df739f12ac358f5eae2bf6a192a27d98d476 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// edition:2018
// compile-flags: -Z mir-opt-level=3

#[inline(always)]
pub fn copy_prop(s: bool) -> String {
    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
}