Closed
Description
Summary
,
Lint Name
collection_is_never_read
Reproducer
I tried this code:
#![warn(clippy::collection_is_never_read)]
pub fn main() {
let mut x: Vec<_> = vec![1, 2, 3];
x.push(4);
// the println() is read as a use, but the .push() returns () so we still never actually use the resulting vec
println!("{:?}", x.push(5));
}
I expected to see this happen:
Lint trigggers
Instead, this happened:
Linnt doesn't trigger
Version
rustc 1.70.0-nightly (8a73f50d8 2023-03-11)
binary: rustc
commit-hash: 8a73f50d875840b8077b8ec080fa41881d7ce40d
commit-date: 2023-03-11
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7