Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/base-db/src/editioned_file_id.rs')
| -rw-r--r-- | crates/base-db/src/editioned_file_id.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/base-db/src/editioned_file_id.rs b/crates/base-db/src/editioned_file_id.rs index 13fb05d565..062e3b59d9 100644 --- a/crates/base-db/src/editioned_file_id.rs +++ b/crates/base-db/src/editioned_file_id.rs @@ -20,7 +20,7 @@ const _: () = { use zalsa_::interned as zalsa_struct_; type Configuration_ = EditionedFileId; - #[derive(Debug, Clone, PartialEq, Eq)] + #[derive(Debug, Clone, Eq)] pub struct EditionedFileIdData { editioned_file_id: span::EditionedFileId, krate: Crate, @@ -52,6 +52,14 @@ const _: () = { editioned_file_id: span::EditionedFileId, } + impl PartialEq for EditionedFileIdData { + fn eq(&self, other: &Self) -> bool { + let Self { editioned_file_id, krate: _ } = self; + let Self { editioned_file_id: other_editioned_file_id, krate: _ } = other; + editioned_file_id == other_editioned_file_id + } + } + impl Hash for EditionedFileIdData { #[inline] fn hash<H: Hasher>(&self, state: &mut H) { @@ -210,6 +218,8 @@ const _: () = { /// 1. The file is not in the module tree. /// 2. You are latency sensitive and cannot afford calling the def map to precisely compute the origin /// (e.g. on enter feature, folding, etc.). + // FIXME: Remove this and all the weird crate ignoring plumbing around this + // This can cause a variety of weird bugs https://rust-lang.zulipchat.com/#narrow/channel/185405-t-compiler.2Frust-analyzer/topic/Broken.20token.20mapping/with/577739887 pub fn from_span_guess_origin( db: &dyn RootQueryDb, editioned_file_id: span::EditionedFileId, @@ -281,6 +291,8 @@ impl EditionedFileId { /// 1. The file is not in the module tree. /// 2. You are latency sensitive and cannot afford calling the def map to precisely compute the origin /// (e.g. on enter feature, folding, etc.). + // FIXME: Remove this and all the weird crate ignoring plumbing around this + // This can cause a variety of weird bugs https://rust-lang.zulipchat.com/#narrow/channel/185405-t-compiler.2Frust-analyzer/topic/Broken.20token.20mapping/with/577739887 #[inline] pub fn current_edition_guess_origin(db: &dyn RootQueryDb, file_id: FileId) -> Self { Self::from_span_guess_origin(db, span::EditionedFileId::current_edition(file_id)) |