are `quote!` and `parse` inverses?

14 Views Asked by At

Can I roundtrip through these two functions freely? If not, what is lost/breaks/changes?

fn identity<T: quote::ToTokens + syn::parse::Parse>(i: T) -> T {
    let x: proc_macro::TokenStream = quote!(#i).into();
    syn::parse(x).unwrap()
}
0

There are 0 best solutions below