Skip to content

Commit 127ec9a

Browse files
committed
Keep a parent LocalDefId in SpanData.
1 parent 6271ded commit 127ec9a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/macros.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,12 @@ impl MacroParser {
12701270
let data = delimited_span.entire().data();
12711271
(
12721272
data.hi,
1273-
Span::new(data.lo + BytePos(1), data.hi - BytePos(1), data.ctxt),
1273+
Span::new(
1274+
data.lo + BytePos(1),
1275+
data.hi - BytePos(1),
1276+
data.ctxt,
1277+
data.parent,
1278+
),
12741279
delimited_span.entire(),
12751280
)
12761281
}

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,11 @@ macro_rules! source {
356356
}
357357

358358
pub(crate) fn mk_sp(lo: BytePos, hi: BytePos) -> Span {
359-
Span::new(lo, hi, SyntaxContext::root())
359+
Span::new(lo, hi, SyntaxContext::root(), None)
360360
}
361361

362362
pub(crate) fn mk_sp_lo_plus_one(lo: BytePos) -> Span {
363-
Span::new(lo, lo + BytePos(1), SyntaxContext::root())
363+
Span::new(lo, lo + BytePos(1), SyntaxContext::root(), None)
364364
}
365365

366366
// Returns `true` if the given span does not intersect with file lines.

0 commit comments

Comments
 (0)