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: swapping with a temporary value is inefficient --> tests/ui/swap_with_temporary.rs:92:13 | LL | swap(&mut vec![42], &mut self.thing.lock().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `*self.thing.lock().unwrap() = vec![42]` | note: this expression returns a temporary value --> tests/ui/swap_with_temporary.rs:92:23 | LL | swap(&mut vec![42], &mut self.thing.lock().unwrap()); | ^^^^^^^^ error: swapping with a temporary value is inefficient --> tests/ui/swap_with_temporary.rs:100:5 | LL | swap(&mut ***v1, &mut vec![]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `***v1 = vec![]` | note: this expression returns a temporary value --> tests/ui/swap_with_temporary.rs:100:27 | LL | swap(&mut ***v1, &mut vec![]); | ^^^^^^ error: swapping with a temporary value is inefficient --> tests/ui/swap_with_temporary.rs:118:5 | LL | swap(&mut vec![], &mut v1.lock().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use assignment instead: `***v1.lock().unwrap() = vec![]` | note: this expression returns a temporary value --> tests/ui/swap_with_temporary.rs:118:15 | LL | swap(&mut vec![], &mut v1.lock().unwrap()); | ^^^^^^ error: aborting due to 11 previous errors