]> git.proxmox.com Git - rustc.git/blob - tests/mir-opt/copy-prop/move_arg.rs
New upstream version 1.75.0+dfsg1
[rustc.git] / tests / mir-opt / copy-prop / move_arg.rs
1 // skip-filecheck
2 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
3 // Test that we do not move multiple times from the same local.
4 // unit-test: CopyProp
5
6 // EMIT_MIR move_arg.f.CopyProp.diff
7 pub fn f<T: Copy>(a: T) {
8 let b = a;
9 g(a, b);
10 }
11
12 #[inline(never)]
13 pub fn g<T: Copy>(_: T, _: T) {}
14
15 fn main() {
16 f(5)
17 }