Lifetimes

This commit is contained in:
2026-05-08 20:15:56 +02:00
parent 020dd3b76b
commit 910657c755
3 changed files with 7 additions and 0 deletions
+1
View File
@@ -41,6 +41,7 @@ pub enum TypeExprKind {
Path(Path),
PathParams(Path, Vec<TypeExpr>),
Tuple(Vec<TypeExpr>),
Lifetime(Identifier),
}
#[derive(Debug, Clone, Serialize)]
+5
View File
@@ -36,6 +36,11 @@ impl From<pest::iterators::Pair<'_, Rule>> for TypeExpr {
TypeExprKind::from(inner.next().unwrap()),
inner.map(TypePostfix::from).collect(),
),
Rule::type_expr_param => TypeExpr::from(inner.next().unwrap()),
Rule::lifetime => TypeExpr(
TypeExprKind::Lifetime(Identifier::from(inner.next().unwrap())),
Vec::new(),
),
_ => unimplemented!("{rule:#?}"),
}
}