aboutsummaryrefslogtreecommitdiffstats
path: root/src/lifetime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lifetime.rs')
-rw-r--r--src/lifetime.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lifetime.rs b/src/lifetime.rs
index 9cec5eec..28cd7e36 100644
--- a/src/lifetime.rs
+++ b/src/lifetime.rs
@@ -57,6 +57,17 @@ impl Lifetime {
ident: Ident::new(&symbol[1..], span),
}
}
+
+ pub fn span(&self) -> Span {
+ self.apostrophe
+ .join(self.ident.span())
+ .unwrap_or(self.apostrophe)
+ }
+
+ pub fn set_span(&mut self, span: Span) {
+ self.apostrophe = span;
+ self.ident.set_span(span);
+ }
}
impl Display for Lifetime {