| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:22:5 |
| | |
| LL | swap(&mut func(), &mut y); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `y = func()` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:22:15 |
| | |
| LL | swap(&mut func(), &mut y); |
| | ^^^^^^ |
| = note: `-D clippy::swap-with-temporary` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::swap_with_temporary)]` |
| |
| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:25:5 |
| | |
| LL | swap(&mut x, &mut func()); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `x = func()` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:25:23 |
| | |
| LL | swap(&mut x, &mut func()); |
| | ^^^^^^ |
| |
| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:28:5 |
| | |
| LL | swap(z, &mut func()); |
| | ^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `*z = func()` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:28:18 |
| | |
| LL | swap(z, &mut func()); |
| | ^^^^^^ |
| |
| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:36:5 |
| | |
| LL | swap(&mut func(), z); |
| | ^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `*z = func()` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:36:15 |
| | |
| LL | swap(&mut func(), z); |
| | ^^^^^^ |
| |
| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:53:5 |
| | |
| LL | swap(&mut mac!(funcall func), z); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `*z = mac!(funcall func)` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:53:15 |
| | |
| LL | swap(&mut mac!(funcall func), z); |
| | ^^^^^^^^^^^^^^^^^^ |
| |
| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:55:5 |
| | |
| LL | swap(&mut mac!(funcall func), mac!(ident z)); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `*mac!(ident z) = mac!(funcall func)` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:55:15 |
| | |
| LL | swap(&mut mac!(funcall func), mac!(ident z)); |
| | ^^^^^^^^^^^^^^^^^^ |
| |
| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:57:5 |
| | |
| LL | swap(mac!(ident z), &mut mac!(funcall func)); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `*mac!(ident z) = mac!(funcall func)` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:57:30 |
| | |
| LL | swap(mac!(ident z), &mut mac!(funcall func)); |
| | ^^^^^^^^^^^^^^^^^^ |
| |
| error: swapping with a temporary value is inefficient |
| --> tests/ui/swap_with_temporary.rs:59:5 |
| | |
| LL | swap(mac!(refmut y), &mut func()); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `*mac!(refmut y) = func()` |
| | |
| note: this expression returns a temporary value |
| --> tests/ui/swap_with_temporary.rs:59:31 |
| | |
| LL | swap(mac!(refmut y), &mut func()); |
| | ^^^^^^ |
| |
| error: aborting due to 8 previous errors |
| |