Skip to content

Macro Statements should be also an Expr #29

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

Merged
merged 1 commit into from
Mar 15, 2021
Merged

Macro Statements should be also an Expr #29

merged 1 commit into from
Mar 15, 2021

Conversation

edwin0cheng
Copy link
Member

@edwin0cheng edwin0cheng commented Mar 8, 2021

e.g:

macro_rules! identity { ($($es:tt)*) => { $($es)* } }

fn main() -> usize { 
  identity! { let _ = (); }   //  statements
  identity! { let _ = (); 0 }   // expr, return 0
}

@edwin0cheng
Copy link
Member Author

CC rust-lang/rust-analyzer#7845

@edwin0cheng
Copy link
Member Author

(ping) I am not familiar ungrammer part, so I would like to someone to review this PR first :)

@Veykril Veykril mentioned this pull request Mar 15, 2021
@jonas-schievink
Copy link
Contributor

This does seem like a correct change, yeah.

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 15, 2021

Build succeeded:

@bors bors bot merged commit 6cf7007 into master Mar 15, 2021
@bors bors bot deleted the macro-stmts-expr branch March 15, 2021 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants