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

This commit is contained in:
MarcusGrass 2023-06-01 15:53:20 +02:00
parent 652b4c720d
commit 62eb4e7d7b
No known key found for this signature in database
GPG Key ID: B3F995FE064E3AA9

View File

@ -25,6 +25,12 @@
/// 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 [rust-lang issue 37612](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 {