Skip to content
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

Keep non-brace macro invocations in trailing expr position as Expr::Macro #1420

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Mar 22, 2023

Rust does not allow a stmt macro to be called with this syntax.

macro_rules! m {
    () => {
        struct S;
    }
}

fn main() {
    m!()
}

But if the call is written as m!(); or m! {}, we'll continue to parse it as Stmt::Macro.

@dtolnay dtolnay merged commit e76d644 into master Mar 22, 2023
@dtolnay dtolnay deleted the nonbracemacro branch March 22, 2023 20:27
smoelius added a commit to smoelius/necessist that referenced this pull request Mar 31, 2023
smoelius added a commit to trailofbits/necessist that referenced this pull request Apr 1, 2023
dependabot bot pushed a commit to trailofbits/necessist that referenced this pull request Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant