]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lint/let_underscore/let_underscore_lock.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / lint / let_underscore / let_underscore_lock.stderr
1 error: non-binding let on a synchronization lock
2 --> $DIR/let_underscore_lock.rs:6:9
3 |
4 LL | let _ = data.lock().unwrap();
5 | ^ ^^^^^^^^^^^^^^^^^^^^ this binding will immediately drop the value assigned to it
6 | |
7 | this lock is not assigned to a binding and is immediately dropped
8 |
9 = note: `#[deny(let_underscore_lock)]` on by default
10 help: consider binding to an unused variable to avoid immediately dropping the value
11 |
12 LL | let _unused = data.lock().unwrap();
13 | ~~~~~~~
14 help: consider immediately dropping the value
15 |
16 LL | drop(data.lock().unwrap());
17 | ~~~~~ +
18
19 error: aborting due to previous error
20