Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Nested macro with attribute internal_macro_calls requires increasing in case of nested macro calls #43

@olegnn

Description

@olegnn

I'm very sorry to worry you again, but the problem with nested macros still exists.
For now, there's no way to invoke nested macro in nested macro without increasing internal_macro_calls. In example below this value in join_all! macro attribute is 5 because in code

#[proc_macro_hack(support_nested, internal_macro_calls = 5)]
pub use proc_macro_hack_bug_impl::join_all;

async fn add_nested_custom_joined_results() -> usize {
    let results = join_all!(ready(join_all!(ready(7usize)).0), ready(join_all!(ready(8usize)).0), ready(join_all!(ready(join_all!(ready(9usize)).0)).0));
    results.0 + results.1 + results.2
}

we have 5 calls of join_all! macro each of which inserts 1 nested join! macro. Of course this problem can be solved by setting internal_macro_calls to maximum value, but...

Unfortunately, in situation with join_all_x2! even value of 60 doesn't help. ===> https://github.com/olegnn/proc_macro_hack_bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions