diff options
author | Lukas Wirth <[email protected]> | 2021-04-05 19:46:15 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-04-05 19:46:15 +0100 |
commit | d587ca2991406bd348768b2912c3cb66c869e7e8 (patch) | |
tree | 91f0421f3ca76f846548017d8a6c5a4b142b96bc /crates/hir_ty/src/lib.rs | |
parent | 87e56eb94ced9943977a38e7d4c6697587187ce6 (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.rs | 14 |
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 | ||
36 | use base_db::salsa; | 36 | use base_db::salsa; |
37 | use hir_def::{ | 37 | use 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 | ||
42 | use crate::{db::HirDatabase, display::HirDisplay, utils::generics}; | 42 | use crate::{db::HirDatabase, display::HirDisplay, utils::generics}; |
@@ -70,6 +70,10 @@ pub type VariableKind = chalk_ir::VariableKind<Interner>; | |||
70 | pub type VariableKinds = chalk_ir::VariableKinds<Interner>; | 70 | pub type VariableKinds = chalk_ir::VariableKinds<Interner>; |
71 | pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>; | 71 | pub type CanonicalVarKinds = chalk_ir::CanonicalVarKinds<Interner>; |
72 | 72 | ||
73 | pub type Lifetime = chalk_ir::Lifetime<Interner>; | ||
74 | pub type LifetimeData = chalk_ir::LifetimeData<Interner>; | ||
75 | pub type LifetimeOutlives = chalk_ir::LifetimeOutlives<Interner>; | ||
76 | |||
73 | pub type ChalkTraitId = chalk_ir::TraitId<Interner>; | 77 | pub type ChalkTraitId = chalk_ir::TraitId<Interner>; |
74 | 78 | ||
75 | impl ProjectionTy { | 79 | impl ProjectionTy { |
@@ -546,6 +550,12 @@ pub fn to_placeholder_idx(db: &dyn HirDatabase, id: TypeParamId) -> PlaceholderI | |||
546 | } | 550 | } |
547 | } | 551 | } |
548 | 552 | ||
553 | pub 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 | |||
549 | pub fn to_chalk_trait_id(id: TraitId) -> ChalkTraitId { | 559 | pub 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 | } |