Skip to content

Commit 08454be

Browse files
committed
Keep Known Problems documentation in redundant_pattern_matching
1 parent f915f8f commit 08454be

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clippy_lints/src/matches.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,12 @@ declare_clippy_lint! {
424424
/// **Why is this bad?** It's more concise and clear to just use the proper
425425
/// utility function
426426
///
427-
/// **Known problems:** None.
427+
/// **Known problems:** This will change the drop order for the matched type. Both `if let` and
428+
/// `while let` will drop the value at the end of the block, both `if` and `while` will drop the
429+
/// value before entering the block. For most types this change will not matter, but for a few
430+
/// types this will not be an acceptable change (e.g. locks). See the
431+
/// [reference](https://doc.rust-lang.org/reference/destructors.html#drop-scopes) for more about
432+
/// drop order.
428433
///
429434
/// **Example:**
430435
///

0 commit comments

Comments
 (0)