mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Note about const fn
Since `std::mem::swap` is not stable as a const fn, the suggestion would not be applicable in that cases
This commit is contained in:
parent
928a158716
commit
3c86cade4e
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user