“cannot find value `a` in this scope” in Rust macro
问题 I created macro for printing, using proc-macro-hack. Then this error occured though I already have defined a . Following is the code. On decl crate, proc_macro_expr_decl! { /// Function for printing to the standard output. /// /// First argument can be literal or not literal. gprint! => gprint_impl } On impl crate, use syn::{Expr, ExprTuple, parse_str}; use quote::ToTokens; fn _print_impl(input: &str, print_name: &str) -> String { let mut input_with_parens = String::with_capacity(input.len()