Skip to content

"Inline macro" doesn't work inside proc_macro_attribute #19795

@clouds56

Description

@clouds56

If I have normal function, I could expand macros like println inside it

fn test1() {
  println!("hello"); // I could do "inline macro" here
}

But I couldn't if the function under proc_macro_attribute like async_trait

#[async_trait]
impl A for S {
  fn test2() {
    println!("hello"); // I couldn't do "inline macro" here
  }
}

I know in some cases the outer proc_macro_attribute would change the AST inside it while I think in many cases it just keeps the inner TokenStream

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions