diff options
author | Florian Diebold <[email protected]> | 2021-03-13 18:27:09 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-13 18:27:09 +0000 |
commit | 2d69eb131f58dee1bc188b8df8d5cf0ebf9d97f2 (patch) | |
tree | b22507ea0b79fcd5d38dcf5ae8b731467a38cc41 /crates/hir_ty/src/lib.rs | |
parent | be7a31fbd64943f71afe11b0413c99496526dddc (diff) |
Use chalk_ir::ClosureId
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 6b3485264..ec2010e4b 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -27,9 +27,8 @@ use std::{iter, mem, ops::Deref, sync::Arc}; | |||
27 | 27 | ||
28 | use base_db::salsa; | 28 | use base_db::salsa; |
29 | use hir_def::{ | 29 | use hir_def::{ |
30 | builtin_type::BuiltinType, expr::ExprId, type_ref::Rawness, AssocContainerId, DefWithBodyId, | 30 | builtin_type::BuiltinType, expr::ExprId, type_ref::Rawness, AssocContainerId, FunctionId, |
31 | FunctionId, GenericDefId, HasModule, LifetimeParamId, Lookup, TraitId, TypeAliasId, | 31 | GenericDefId, HasModule, LifetimeParamId, Lookup, TraitId, TypeAliasId, TypeParamId, |
32 | TypeParamId, | ||
33 | }; | 32 | }; |
34 | use itertools::Itertools; | 33 | use itertools::Itertools; |
35 | 34 | ||
@@ -53,7 +52,8 @@ pub use crate::traits::chalk::Interner; | |||
53 | 52 | ||
54 | pub type ForeignDefId = chalk_ir::ForeignDefId<Interner>; | 53 | pub type ForeignDefId = chalk_ir::ForeignDefId<Interner>; |
55 | pub type AssocTypeId = chalk_ir::AssocTypeId<Interner>; | 54 | pub type AssocTypeId = chalk_ir::AssocTypeId<Interner>; |
56 | pub(crate) type FnDefId = chalk_ir::FnDefId<Interner>; | 55 | pub type FnDefId = chalk_ir::FnDefId<Interner>; |
56 | pub type ClosureId = chalk_ir::ClosureId<Interner>; | ||
57 | 57 | ||
58 | #[derive(Clone, PartialEq, Eq, Debug, Hash)] | 58 | #[derive(Clone, PartialEq, Eq, Debug, Hash)] |
59 | pub enum Lifetime { | 59 | pub enum Lifetime { |
@@ -195,7 +195,7 @@ pub enum TyKind { | |||
195 | /// | 195 | /// |
196 | /// The closure signature is stored in a `FnPtr` type in the first type | 196 | /// The closure signature is stored in a `FnPtr` type in the first type |
197 | /// parameter. | 197 | /// parameter. |
198 | Closure(DefWithBodyId, ExprId, Substs), | 198 | Closure(ClosureId, Substs), |
199 | 199 | ||
200 | /// Represents a foreign type declared in external blocks. | 200 | /// Represents a foreign type declared in external blocks. |
201 | ForeignType(ForeignDefId), | 201 | ForeignType(ForeignDefId), |
@@ -734,9 +734,7 @@ impl Ty { | |||
734 | ty_id == ty_id2 | 734 | ty_id == ty_id2 |
735 | } | 735 | } |
736 | (TyKind::ForeignType(ty_id, ..), TyKind::ForeignType(ty_id2, ..)) => ty_id == ty_id2, | 736 | (TyKind::ForeignType(ty_id, ..), TyKind::ForeignType(ty_id2, ..)) => ty_id == ty_id2, |
737 | (TyKind::Closure(def, expr, _), TyKind::Closure(def2, expr2, _)) => { | 737 | (TyKind::Closure(id1, _), TyKind::Closure(id2, _)) => id1 == id2, |
738 | expr == expr2 && def == def2 | ||
739 | } | ||
740 | (TyKind::Ref(mutability, ..), TyKind::Ref(mutability2, ..)) | 738 | (TyKind::Ref(mutability, ..), TyKind::Ref(mutability2, ..)) |
741 | | (TyKind::Raw(mutability, ..), TyKind::Raw(mutability2, ..)) => { | 739 | | (TyKind::Raw(mutability, ..), TyKind::Raw(mutability2, ..)) => { |
742 | mutability == mutability2 | 740 | mutability == mutability2 |