aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-04-05 19:46:15 +0100
committerLukas Wirth <[email protected]>2021-04-05 19:46:15 +0100
commitd587ca2991406bd348768b2912c3cb66c869e7e8 (patch)
tree91f0421f3ca76f846548017d8a6c5a4b142b96bc /crates/hir_ty/src/lib.rs
parent87e56eb94ced9943977a38e7d4c6697587187ce6 (diff)
Replace unused hir_ty::Lifetime with chalk equivalents
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index daf379ef8..a3addc8e9 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -35,8 +35,8 @@ use smallvec::SmallVec;
35 35
36use base_db::salsa; 36use base_db::salsa;
37use hir_def::{ 37use hir_def::{
38 expr::ExprId, type_ref::Rawness, AssocContainerId, FunctionId, GenericDefId, HasModule, Lookup, 38 expr::ExprId, type_ref::Rawness, AssocContainerId, FunctionId, GenericDefId, HasModule,
39 TraitId, TypeAliasId, TypeParamId, 39 LifetimeParamId, Lookup, TraitId, TypeAliasId, TypeParamId,
40}; 40};
41 41
42use crate::{db::HirDatabase, display::HirDisplay, utils::generics}; 42use crate::{db::HirDatabase, display::HirDisplay, utils::generics};
@@ -70,6 +70,10 @@ pub type VariableKind = chalk_ir::VariableKind<Interner>;
70pub type VariableKinds = chalk_ir::VariableKinds<Interner>; 70pub type VariableKinds = chalk_ir::VariableKinds<Interner>;
71pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>; 71pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>;
72 72
73pub type Lifetime = chalk_ir::Lifetime<Interner>;
74pub type LifetimeData = chalk_ir::LifetimeData<Interner>;
75pub type LifetimeOutlives = chalk_ir::LifetimeOutlives<Interner>;
76
73pub type ChalkTraitId = chalk_ir::TraitId<Interner>; 77pub type ChalkTraitId = chalk_ir::TraitId<Interner>;
74 78
75impl ProjectionTy { 79impl ProjectionTy {
@@ -546,6 +550,12 @@ pub fn to_placeholder_idx(db: &dyn HirDatabase, id: TypeParamId) -> PlaceholderI
546 } 550 }
547} 551}
548 552
553pub fn lt_from_placeholder_idx(db: &dyn HirDatabase, idx: PlaceholderIndex) -> LifetimeParamId {
554 assert_eq!(idx.ui, chalk_ir::UniverseIndex::ROOT);
555 let interned_id = salsa::InternKey::from_intern_id(salsa::InternId::from(idx.idx));
556 db.lookup_intern_lifetime_param_id(interned_id)
557}
558
549pub fn to_chalk_trait_id(id: TraitId) -> ChalkTraitId { 559pub fn to_chalk_trait_id(id: TraitId) -> ChalkTraitId {
550 chalk_ir::TraitId(salsa::InternKey::as_intern_id(&id)) 560 chalk_ir::TraitId(salsa::InternKey::as_intern_id(&id))
551} 561}