1
Fork 0

Turn some functions from token.rs into methods on Ident

This commit is contained in:
Vadim Petrochenkov 2018-05-13 16:14:43 +03:00
parent f4cbc2388f
commit c4352ff198
10 changed files with 80 additions and 67 deletions

View file

@ -300,6 +300,12 @@ impl Span {
self.ctxt().outer().expn_info().map(|i| i.call_site)
}
/// Edition of the crate from which this span came.
pub fn edition(self) -> edition::Edition {
self.ctxt().outer().expn_info().map_or_else(|| hygiene::default_edition(),
|einfo| einfo.callee.edition)
}
/// Return the source callee.
///
/// Returns None if the supplied span has no expansion trace,