Closed
Description
I tried this code with the new rustc lint:
fn main() {
let _ = std::sync::Mutex::new(()).lock();
}
Clippy warns here, but rustc doesn't. This might be intentional, but I think this could be a source of mistakes...
The rustc lint is triggered, as soon as I use .lock().unwrap()
Meta
rustc --version --verbose
:
rustc 1.66.0-nightly (0ca356586 2022-10-06)
binary: rustc
commit-hash: 0ca356586fed56002b10920fd21ddf6fb12de797
commit-date: 2022-10-06
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.2