Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: non-binding let on a synchronization lock #71

Closed
tjni opened this issue Dec 7, 2022 · 1 comment
Closed

error: non-binding let on a synchronization lock #71

tjni opened this issue Dec 7, 2022 · 1 comment

Comments

@tjni
Copy link

tjni commented Dec 7, 2022

Due to a new lint in rust 1.65 introduced by rust-lang/rust#97739, there is a new compilation error:

error: non-binding let on a synchronization lock
   --> src/catfs/file.rs:570:13
    |
570 |         let _ = self.page_in_res.0.lock().unwrap();
    |             ^   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this binding will immediately drop the value assigned to it
    |             |
    |             this lock is not assigned to a binding and is immediately dropped
    |
    = note: `#[deny(let_underscore_lock)]` on by default
help: consider binding to an unused variable to avoid immediately dropping the value
    |
570 |         let _unused = self.page_in_res.0.lock().unwrap();
    |             ~~~~~~~
help: consider immediately dropping the value
    |
570 |         drop(self.page_in_res.0.lock().unwrap());
    |         ~~~~~                                  +

(Ignore the line numbers as they correspond to an older version, but I was able to verify it still occurs in v0.9.0 and the code triggering the error still exists.)

I was planning to fix this, but I can't figure out what the purpose of that line is. Is this mutex being used to gate access to more things than its internal data?

@gaul
Copy link
Collaborator

gaul commented Oct 9, 2023

Resolved by 322b087.

@gaul gaul closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants