Turn some functions from token.rs
into methods on Ident
This commit is contained in:
parent
f4cbc2388f
commit
c4352ff198
10 changed files with 80 additions and 67 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue