Lint name: mutable_key_type
I tried this code:
use std::collections::HashSet;
fn main() {
let s: HashSet<*mut ()> = HashSet::new();
}
I expected to see this happen: lint not triggered because raw pointers are compared and hashed by pointer value rather than by pointed-to value
Instead, this happened: lint triggered
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=601da4e6cf6eb0b2c178c32fcab35390
Meta
cargo clippy -V: clippy 0.1.52 (d1206f9 2021-02-15)
rustc -Vv:
rustc 1.52.0-nightly (d1206f950 2021-02-15)
binary: rustc
commit-hash: d1206f950ffb76c76e1b74a19ae33c2b7d949454
commit-date: 2021-02-15
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1
Lint name: mutable_key_type
I tried this code:
I expected to see this happen: lint not triggered because raw pointers are compared and hashed by pointer value rather than by pointed-to value
Instead, this happened: lint triggered
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=601da4e6cf6eb0b2c178c32fcab35390
Meta
cargo clippy -V: clippy 0.1.52 (d1206f9 2021-02-15)rustc -Vv: