]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/issue-85197-invalid-span/auxiliary/respan.rs
4 #![crate_type = "proc-macro"]
6 extern crate proc_macro
;
7 use proc_macro
::TokenStream
;
10 /// Copies the resolution information (the `SyntaxContext`) of the first
11 /// token to all other tokens in the stream. Does not recurse into groups.
13 pub fn respan(input
: TokenStream
) -> TokenStream
{
14 let first_span
= input
.clone().into_iter().next().unwrap().span();
15 input
.into_iter().map(|mut tree
| {
16 tree
.set_span(tree
.span().resolved_at(first_span
));