1
Fork 0

rustc_span: Add conveniences for working with span formats

This commit is contained in:
Vadim Petrochenkov 2024-03-03 15:34:22 +03:00
parent b6e5e3ffbb
commit 4440f50996
2 changed files with 149 additions and 100 deletions

View file

@ -520,6 +520,7 @@ impl SpanData {
pub fn with_hi(&self, hi: BytePos) -> Span {
Span::new(self.lo, hi, self.ctxt, self.parent)
}
/// Avoid if possible, `Span::update_ctxt` should be preferred.
#[inline]
fn with_ctxt(&self, ctxt: SyntaxContext) -> Span {
Span::new(self.lo, self.hi, ctxt, self.parent)