rust/src/libproc_macro
bors c5fb4d0d2f Auto merge of #55780 - ogoffart:span_source_text, r=petrochenkov
Introduce proc_macro::Span::source_text

A function to extract the actual source behind a Span.

Background: I would like to use `syn` in a `build.rs` script to parse the rust code, and extract part of the source code. However, `syn` only gives access to proc_macro2::Span, and i would like to get the source code behind that.
I opened an issue on proc_macro2 bug tracker for this feature https://github.com/alexcrichton/proc-macro2/issues/110  and @alexcrichton said the feature should first go upstream in proc_macro.  So there it is!

Since most of the Span API is unstable anyway, this is guarded by the same `proc_macro_span` feature as everything else.
2019-03-27 08:58:40 +00:00
..
bridge Auto merge of #55780 - ogoffart:span_source_text, r=petrochenkov 2019-03-27 08:58:40 +00:00
Cargo.toml libproc_macro => 2018 2019-02-04 03:55:40 +09:00
diagnostic.rs tests: doc comments 2019-02-10 23:42:32 +00:00
lib.rs Auto merge of #55780 - ogoffart:span_source_text, r=petrochenkov 2019-03-27 08:58:40 +00:00
quote.rs libproc_macro => 2018 2019-02-04 03:55:40 +09:00