mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
implement resolving and lowering of Lifetimes
This commit is contained in:
parent
d3eeadc242
commit
f95b3d4cd2
5 changed files with 126 additions and 16 deletions
|
@ -151,6 +151,14 @@ pub fn lt_from_placeholder_idx(db: &dyn HirDatabase, idx: PlaceholderIndex) -> L
|
|||
db.lookup_intern_lifetime_param_id(interned_id)
|
||||
}
|
||||
|
||||
pub(crate) fn lt_to_placeholder_idx(db: &dyn HirDatabase, id: LifetimeParamId) -> PlaceholderIndex {
|
||||
let interned_id = db.intern_lifetime_param_id(id);
|
||||
PlaceholderIndex {
|
||||
ui: chalk_ir::UniverseIndex::ROOT,
|
||||
idx: salsa::InternKey::as_intern_id(&interned_id).as_usize(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_chalk_trait_id(id: TraitId) -> ChalkTraitId {
|
||||
chalk_ir::TraitId(salsa::InternKey::as_intern_id(&id))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue