aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs14
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
28use base_db::salsa; 28use base_db::salsa;
29use hir_def::{ 29use 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};
34use itertools::Itertools; 33use itertools::Itertools;
35 34
@@ -53,7 +52,8 @@ pub use crate::traits::chalk::Interner;
53 52
54pub type ForeignDefId = chalk_ir::ForeignDefId<Interner>; 53pub type ForeignDefId = chalk_ir::ForeignDefId<Interner>;
55pub type AssocTypeId = chalk_ir::AssocTypeId<Interner>; 54pub type AssocTypeId = chalk_ir::AssocTypeId<Interner>;
56pub(crate) type FnDefId = chalk_ir::FnDefId<Interner>; 55pub type FnDefId = chalk_ir::FnDefId<Interner>;
56pub type ClosureId = chalk_ir::ClosureId<Interner>;
57 57
58#[derive(Clone, PartialEq, Eq, Debug, Hash)] 58#[derive(Clone, PartialEq, Eq, Debug, Hash)]
59pub enum Lifetime { 59pub 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