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.
Rollup of 7 pull requests
Successful merges:
- #59004 ([rustdoc] Improve "in parameters" search and search more generally)
- #59026 (Fix moving text in search tabs headers)
- #59197 (Exclude old book redirect stubs from search engines)
- #59330 (Improve the documentation for std::convert (From, Into, AsRef and AsMut))
- #59424 (Fix code block display in portability element in dark theme)
- #59427 (Link to PhantomData in NonNull documentation)
- #59432 (Improve some compiletest documentation)
Failed merges:
r? @ghost
Improve the documentation for std::convert (From, Into, AsRef and AsMut)
# Description
In this PR I updated the documentation of From, Into, AsRef and AsMut, as well as the general std::convert module documentation. The discussion in #59163 provided information that was not yet present in the docs, or was not expressed clearly enough. I tried to clarify the examples that were already present in the docs as well as add more information about considered best-practices that came out of the discussion in #59163
@steveklabnik I hope I didn't change too much. This is an initial version! I will scan through everything tomorrow as well again to see if I made any typo's or errors, and maybe make some small changes here and there.
All suggestions are welcome!
closes#59163
Exclude old book redirect stubs from search engines
Adds `<meta name="robots" content="noindex,follow">` to the `<head>` of old stub pages pointing to the second edition of the book.
This is continuation of https://github.com/rust-lang/book/pull/1788