summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/issue-77002.rs
blob: 0c37346eaf803d87375d2206528fe23714a57265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// compile-flags: -Zmir-opt-level=3 -Copt-level=0
// run-pass

type M = [i64; 2];

fn f(a: &M) -> M {
    let mut b: M = M::default();
    b[0] = a[0] * a[0];
    b
}

fn main() {
    let mut a: M = [1, 1];
    a = f(&a);
    assert_eq!(a[0], 1);
}