do not overwrite spans as eagerly
this was required to preserve the span from the #[structural_match] attribute -- but honestly I am not 100% sure if it makes sense.
This commit is contained in:
parent
99c2a6b335
commit
05baf645e4
2 changed files with 61 additions and 6 deletions
|
@ -1304,6 +1304,31 @@ impl CodeMap {
|
|||
return a;
|
||||
}
|
||||
|
||||
/// Check if the backtrace `subtrace` contains `suptrace` as a prefix.
|
||||
pub fn more_specific_trace(&self,
|
||||
mut subtrace: ExpnId,
|
||||
suptrace: ExpnId)
|
||||
-> bool {
|
||||
loop {
|
||||
if subtrace == suptrace {
|
||||
return true;
|
||||
}
|
||||
|
||||
let stop = self.with_expn_info(subtrace, |opt_expn_info| {
|
||||
if let Some(expn_info) = opt_expn_info {
|
||||
subtrace = expn_info.call_site.expn_id;
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
});
|
||||
|
||||
if stop {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn record_expansion(&self, expn_info: ExpnInfo) -> ExpnId {
|
||||
let mut expansions = self.expansions.borrow_mut();
|
||||
expansions.push(expn_info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue