Skip to content

Resolve the nested inner macros correctly #12404

Closed
@edwardw

Description

@edwardw

Currently, the inner macro in a nested macro invocation is not properly resolved which prevents nested macro invocation from working. If we are to support such invocation, this issue ought to be fixed.

cc #11692. #9323 is also relevant with regard to the macro scope rules in general.


Example from #13876:

The expression println!(format!("test")) produces the following error:

<anon>:18:18: 18:24 error: macro undefined: 'format'
<anon>:18         println!(format!("test"))
                           ^~~~~~
<anon>:18:18: 18:33 error: format argument must be a string literal.
<anon>:18         println!(format!("test"))
                           ^~~~~~~~~~~~~~~
error: aborting due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions