Skip to content

Commit

Permalink
Merge pull request #971 from dtolnay/lifetime-span
Browse files Browse the repository at this point in the history
Add Lifetime span getter and setter
  • Loading branch information
dtolnay committed Mar 5, 2021
2 parents 38d99a7 + 9001d9f commit de1a51d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lifetime.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit de1a51d

Please sign in to comment.