rustc_span: Add conveniences for working with span formats
This commit is contained in:
parent
b6e5e3ffbb
commit
4440f50996
2 changed files with 149 additions and 100 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue