aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/path
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2020-12-11 12:49:32 +0000
committerLukas Wirth <[email protected]>2020-12-11 23:56:52 +0000
commit11f86641829273e2b2b7023c2028bb475fce58ee (patch)
tree8633b96c3f812412ea6c19acb1b6a770292d4697 /crates/hir_def/src/path
parent41321d96789ed918eebda02ada76758765d19d16 (diff)
Add Lifetimes to the HIR
Diffstat (limited to 'crates/hir_def/src/path')
-rw-r--r--crates/hir_def/src/path/lower.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/hir_def/src/path/lower.rs b/crates/hir_def/src/path/lower.rs
index 07b9723ce..60fa7646b 100644
--- a/crates/hir_def/src/path/lower.rs
+++ b/crates/hir_def/src/path/lower.rs
@@ -15,7 +15,7 @@ use super::AssociatedTypeBinding;
15use crate::{ 15use crate::{
16 body::LowerCtx, 16 body::LowerCtx,
17 path::{GenericArg, GenericArgs, ModPath, Path, PathKind}, 17 path::{GenericArg, GenericArgs, ModPath, Path, PathKind},
18 type_ref::{TypeBound, TypeRef}, 18 type_ref::{LifetimeRef, TypeBound, TypeRef},
19}; 19};
20 20
21pub(super) use lower_use::lower_use_tree; 21pub(super) use lower_use::lower_use_tree;
@@ -170,8 +170,14 @@ pub(super) fn lower_generic_args(
170 bindings.push(AssociatedTypeBinding { name, type_ref, bounds }); 170 bindings.push(AssociatedTypeBinding { name, type_ref, bounds });
171 } 171 }
172 } 172 }
173 // Lifetimes and constants are ignored for now. 173 ast::GenericArg::LifetimeArg(lifetime_arg) => {
174 ast::GenericArg::LifetimeArg(_) | ast::GenericArg::ConstArg(_) => (), 174 if let Some(lifetime) = lifetime_arg.lifetime_token() {
175 let lifetime_ref = LifetimeRef::from_token(lifetime);
176 args.push(GenericArg::Lifetime(lifetime_ref))
177 }
178 }
179 // constants are ignored for now.
180 ast::GenericArg::ConstArg(_) => (),
175 } 181 }
176 } 182 }
177 183