Closed
Description
Summary
it appears that the unwrap_used
lint does not trigger for code of the form foo.get(i).unwrap()
or foo.get_mut(i).unwrap()
Lint Name
unwrap_used
Reproducer
I tried this code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2ed9ce35f88fd2d4c16151aeed566134
I expected to see this happen:
all three functions should trigger the unwrap_used
lint
Instead, this happened:
the second function does not trigger the lint
Version
rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-unknown-linux-gnu
release: 1.57.0
LLVM version: 13.0.0