mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 08:05:12 +00:00
17 lines
251 B
Rust
17 lines
251 B
Rust
//@ 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);
|
|
}
|