about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-30 22:01:20 +0000
committerbors <bors@rust-lang.org>2022-12-30 22:01:20 +0000
commit09bc37c849d40bfe27be3558fbef8f18bef42f84 (patch)
treeda1032a82fd4a6ae6a695bc3653a9b1c9ff458fd
parent20b0ae4afe3f9e4c5ee5fc90586e55f2515f403b (diff)
parentda7ce6f8102a2502cc4ada73e2bab72b6dfbf8d4 (diff)
downloadrust-09bc37c849d40bfe27be3558fbef8f18bef42f84.tar.gz
rust-09bc37c849d40bfe27be3558fbef8f18bef42f84.zip
Auto merge of #13861 - danieleades:derive-hash, r=Veykril
derive 'Hash'

clippy doesn't like that `PartialEq` is derived, and `Hash` is manually implemented. This PR resolves that by deriving the `Hash` implementation.
-rw-r--r--crates/vfs/src/lib.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/vfs/src/lib.rs b/crates/vfs/src/lib.rs
index afc9a0fa6fb..c61f30387b7 100644
--- a/crates/vfs/src/lib.rs
+++ b/crates/vfs/src/lib.rs
@@ -59,15 +59,10 @@ pub use paths::{AbsPath, AbsPathBuf};
 /// Handle to a file in [`Vfs`]
 ///
 /// Most functions in rust-analyzer use this when they need to refer to a file.
-#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq)]
+#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
 pub struct FileId(pub u32);
 
 impl stdx::hash::NoHashHashable for FileId {}
-impl std::hash::Hash for FileId {
-    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
-        self.0.hash(state);
-    }
-}
 
 /// Storage for all files read by rust-analyzer.
 ///