Skip to content

Commit 3c86cad

Browse files
committed
Note about const fn
Since `std::mem::swap` is not stable as a const fn, the suggestion would not be applicable in that cases
1 parent 928a158 commit 3c86cad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_lints/src/swap.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ declare_clippy_lint! {
1616
/// ### What it does
1717
/// Checks for manual swapping.
1818
///
19+
/// Note that the lint will not be emitted in const blocks, as the suggestion would not be applicable.
20+
///
1921
/// ### Why is this bad?
2022
/// The `std::mem::swap` function exposes the intent better
2123
/// without deinitializing or copying either variable.

0 commit comments

Comments
 (0)