]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/copy-prop/move_arg.rs
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / tests / mir-opt / copy-prop / move_arg.rs
1 // Test that we do not move multiple times from the same local.
2 // unit-test: CopyProp
3
4 // EMIT_MIR move_arg.f.CopyProp.diff
5 pub fn f<T: Copy>(a: T) {
6     let b = a;
7     g(a, b);
8 }
9
10 #[inline(never)]
11 pub fn g<T: Copy>(_: T, _: T) {}
12
13 fn main() {
14     f(5)
15 }