diff options
author | Seivan Heidari <[email protected]> | 2019-11-25 00:54:54 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-25 00:54:54 +0000 |
commit | 15ea338ac991707d330288ba4d1bf5daa0fc75d9 (patch) | |
tree | 16aeab28bcdb07d36aae28e3fb4a385614865a48 /crates/ra_hir/src/ids.rs | |
parent | eb7363d167c7a9f7c73cb950b621eb1dce493318 (diff) | |
parent | f7f9757b6b144385ab8ce57b15764473b1f57331 (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs deleted file mode 100644 index 2b59365fb..000000000 --- a/crates/ra_hir/src/ids.rs +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | //! hir makes heavy use of ids: integer (u32) handlers to various things. You | ||
2 | //! can think of id as a pointer (but without a lifetime) or a file descriptor | ||
3 | //! (but for hir objects). | ||
4 | //! | ||
5 | //! This module defines a bunch of ids we are using. The most important ones are | ||
6 | //! probably `HirFileId` and `DefId`. | ||
7 | |||
8 | use ra_db::salsa; | ||
9 | |||
10 | pub use hir_def::{ | ||
11 | AstItemDef, ConstId, EnumId, FunctionId, ItemLoc, LocationCtx, StaticId, StructId, TraitId, | ||
12 | TypeAliasId, | ||
13 | }; | ||
14 | pub use hir_expand::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, MacroFileKind}; | ||
15 | |||
16 | macro_rules! impl_intern_key { | ||
17 | ($name:ident) => { | ||
18 | impl salsa::InternKey for $name { | ||
19 | fn from_intern_id(v: salsa::InternId) -> Self { | ||
20 | $name(v) | ||
21 | } | ||
22 | fn as_intern_id(&self) -> salsa::InternId { | ||
23 | self.0 | ||
24 | } | ||
25 | } | ||
26 | }; | ||
27 | } | ||
28 | |||
29 | /// This exists just for Chalk, because Chalk just has a single `StructId` where | ||
30 | /// we have different kinds of ADTs, primitive types and special type | ||
31 | /// constructors like tuples and function pointers. | ||
32 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
33 | pub struct TypeCtorId(salsa::InternId); | ||
34 | impl_intern_key!(TypeCtorId); | ||
35 | |||
36 | /// This exists just for Chalk, because our ImplIds are only unique per module. | ||
37 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
38 | pub struct GlobalImplId(salsa::InternId); | ||
39 | impl_intern_key!(GlobalImplId); | ||
40 | |||
41 | /// This exists just for Chalk, because it needs a unique ID for each associated | ||
42 | /// type value in an impl (even synthetic ones). | ||
43 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
44 | pub struct AssocTyValueId(salsa::InternId); | ||
45 | impl_intern_key!(AssocTyValueId); | ||