mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03: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:
@@ -16,6 +16,8 @@
|
||||
/// ### 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.
|
||||
|
||||
Reference in New Issue
Block a user