Skip to content

Commit

Permalink
Auto merge of rust-lang#10859 - MarcusGrass:let-and-ret-known-problem…
Browse files Browse the repository at this point in the history
…s, 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
  • Loading branch information
bors committed Jun 6, 2023
2 parents b033883 + 6f24977 commit 7ee3dcd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clippy_lints/src/returns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7ee3dcd

Please sign in to comment.