Comment a bit, use find_ancestor_in_same_ctxt to suppress some weird macro notes
This commit is contained in:
parent
292ab399b3
commit
6848ba2665
5 changed files with 181 additions and 130 deletions
|
@ -664,6 +664,13 @@ impl Span {
|
|||
Some(self)
|
||||
}
|
||||
|
||||
pub fn find_ancestor_in_same_ctxt(mut self, other: Span) -> Option<Span> {
|
||||
while !Span::eq_ctxt(self, other) {
|
||||
self = self.parent_callsite()?;
|
||||
}
|
||||
Some(self)
|
||||
}
|
||||
|
||||
/// Edition of the crate from which this span came.
|
||||
pub fn edition(self) -> edition::Edition {
|
||||
self.ctxt().edition()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue