Skip to content

Commit 62eb4e7

Browse files
committed
Bring up Rust lang rust-lang#37612 as a known problem for let_and_return
1 parent 652b4c7 commit 62eb4e7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/returns.rs

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ declare_clippy_lint! {
2525
/// It is just extraneous code. Remove it to make your code
2626
/// more rusty.
2727
///
28+
/// ### Known problems
29+
/// In the case of some temporaries, e.g. locks, eliding the variable binding could lead
30+
/// to deadlocks. See [rust-lang issue 37612](https://github.com/rust-lang/rust/issues/37612).
31+
/// This could become relevant if the code is later changed to use the code that would have been
32+
/// bound without first assigning it to a let-binding.
33+
///
2834
/// ### Example
2935
/// ```rust
3036
/// fn foo() -> String {

0 commit comments

Comments
 (0)