Skip to content

Commit 7ee3dcd

Browse files
committed
Auto merge of rust-lang#10859 - MarcusGrass:let-and-ret-known-problems, r=giraffate
Bring up Rust lang rust-lang#37612 as a known problem for let_and_return Fixes rust-lang/rust-clippy#4182. I don't think conforming to this lint could trigger the issue immediately, only if subsequent code-changes go wrong, but I may be mistaken. Since the lint can't trigger it by itself, just closing this issue might be reasonable, if not maybe this PR fixes it. changelog: Update docs for `let_and_return`, mention rust-lang rust-lang#37612
2 parents b033883 + 6f24977 commit 7ee3dcd

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 [this issue](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)