Introduce proc_macro::Span::source_text
This commit is contained in:
parent
d48ab693d1
commit
e88b0d9a94
5 changed files with 59 additions and 2 deletions
|
@ -748,4 +748,7 @@ impl server::Span for Rustc<'_> {
|
|||
fn resolved_at(&mut self, span: Self::Span, at: Self::Span) -> Self::Span {
|
||||
span.with_ctxt(at.ctxt())
|
||||
}
|
||||
fn source_text(&mut self, span: Self::Span) -> Option<String> {
|
||||
self.sess.source_map().span_to_snippet(span).ok()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue