rust-clippy
rust-clippy copied to clipboard
unnecessary_unwrap not produced in 1.76
Summary
The following code doesn't produce a warning for the unnecessary_unwrap
lint. It works as intended in Rust 1.73
Lint Name
unnecessary_unwrap
Reproducer
I tried this code:
fn foo(option: Option<String>) {
if option.is_some() {
println!("{}", option.unwrap());
}
}
I expected to see this happen: To get the unnecessary_unwrap lint's warning.
Instead, this happened: No warnings emitted.
Version
rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: aarch64-apple-darwin
release: 1.76.0
LLVM version: 17.0.6