-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mut
keyword is lost when parsing a fn
#632
Comments
Could you share a minimal runnable piece of code for me to reproduce what you are seeing? Here is what I tried, and the use proc_macro2::TokenStream;
use quote::quote;
use syn::Item;
fn main() {
let code = "fn f(mut x: u8) {}";
let tokens = code.parse::<TokenStream>().unwrap();
if let Item::Fn(function_item) = syn::parse2(tokens.clone()).unwrap() {
println!("tokens: {}\nfunction_item: {}", tokens, quote!(#function_item));
} else {
panic!("expected fn");
}
} |
I'll see if I can come up with something minimal a bit later. This is the macro I was using when I encountered the issue: https://github.com/trezm/Thruster/blob/master/thruster-proc/src/lib.rs#L53-L79 If I rollback to nightly 2019/05/01, the issue does not exist. |
Doing some quick testing, it appears like it could be related to |
Closing this issue since it's a problem with |
Interestingly,
&mut
works fine.The text was updated successfully, but these errors were encountered: