]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/proc-macro/auxiliary/mixed-site-span.rs
4 #![feature(proc_macro_quote)]
6 #![crate_type = "proc-macro"]
8 extern crate proc_macro
;
12 pub fn proc_macro_rules(input
: TokenStream
) -> TokenStream
{
14 let id
= |s
| TokenTree
::from(Ident
::new(s
, Span
::mixed_site()));
15 let item_def
= id("ItemDef");
16 let local_def
= id("local_def");
17 let item_use
= id("ItemUse");
18 let local_use
= id("local_use");
19 let mut single_quote
= Punct
::new('
\''
, Spacing
::Joint
);
20 single_quote
.set_span(Span
::mixed_site());
21 let label_use
: TokenStream
= [
22 TokenTree
::from(single_quote
),
24 ].iter().cloned().collect();
31 break $label_use
; // ERROR
34 let mut dollar_crate
= input
.into_iter().next().unwrap();
35 dollar_crate
.set_span(Span
::mixed_site());
37 type A
= $dollar_crate
::ItemUse
;