about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-27 14:37:54 +0000
committerbors <bors@rust-lang.org>2021-10-27 14:37:54 +0000
commit962e21cf157558c27a660a404545af7e7be53289 (patch)
tree4c5a12defb3a805fe661ea4aa19c1e0fab98382f /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent444ef3e4d5f794baf0ee063ca2bfe52971b73b2f (diff)
parent36d4a4ea82b235e65d5ec32bf8f7a81438cf0e10 (diff)
downloadrust-962e21cf157558c27a660a404545af7e7be53289.tar.gz
rust-962e21cf157558c27a660a404545af7e7be53289.zip
Auto merge of #7875 - mbStavola:unit-hash, r=xFrednet
Add unit-hash lint

changelog: [`unit_hash`] Add lint for hashing unit values

This will lint for situations where the end user is attempting to hash a unit value (`()`), as the implementation in `std` simply [does nothing][impl]. Closes #7159 .

Example:

```rust
().hash(&mut state);

// Should (probably) be replaced with:
0_u8.hash(&mut state);
```

[impl]: https://github.com/rust-lang/rust/blob/a5f164faad4a2fed606b8160fd7ecd2d5cbba381/library/core/src/hash/mod.rs#L656
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions