From 3c86cade4ea11baebaadb96402f8987fa013b31c Mon Sep 17 00:00:00 2001 From: koka Date: Sat, 19 Nov 2022 00:28:02 +0900 Subject: [PATCH] Note about const fn Since `std::mem::swap` is not stable as a const fn, the suggestion would not be applicable in that cases --- clippy_lints/src/swap.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clippy_lints/src/swap.rs b/clippy_lints/src/swap.rs index 68a601705516..c374529d1ea9 100644 --- a/clippy_lints/src/swap.rs +++ b/clippy_lints/src/swap.rs @@ -16,6 +16,8 @@ declare_clippy_lint! { /// ### What it does /// Checks for manual swapping. /// + /// Note that the lint will not be emitted in const blocks, as the suggestion would not be applicable. + /// /// ### Why is this bad? /// The `std::mem::swap` function exposes the intent better /// without deinitializing or copying either variable.