Auto merge of #10859 - MarcusGrass:let-and-ret-known-problems, r=giraffate

Bring up Rust lang #37612 as a known problem for let_and_return

Fixes https://github.com/rust-lang/rust-clippy/issues/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 #37612
This commit is contained in:
bors 2023-06-06 00:09:09 +00:00
commit 7ee3dcdb32
1 changed files with 6 additions and 0 deletions

View File

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