rust/compiler/rustc_ast/src
Yuki Okushi 0716724a0b
Rollup merge of #78376 - Aaron1011:feature/consistent-empty-expr, r=petrochenkov
Treat trailing semicolon as a statement in macro call

See #61733 (comment)

We now preserve the trailing semicolon in a macro invocation, even if
the macro expands to nothing. As a result, the following code no longer
compiles:

```rust
macro_rules! empty {
    () => { }
}

fn foo() -> bool { //~ ERROR mismatched
    { true } //~ ERROR mismatched
    empty!();
}
```

Previously, `{ true }` would be considered the trailing expression, even
though there's a semicolon in `empty!();`

This makes macro expansion more token-based.
2020-11-03 15:27:03 +09:00
..
ast
attr Rollup merge of #78326 - Aaron1011:fix/min-stmt-lints, r=petrochenkov 2020-10-25 18:43:49 +09:00
expand
util Auto merge of #78066 - bugadani:wat, r=jonas-schievink 2020-10-18 13:50:31 +00:00
ast.rs Treat trailing semicolon as a statement in macro call 2020-11-02 13:03:13 -05:00
crate_disambiguator.rs
entry.rs
lib.rs tidy 2020-09-23 22:08:30 +02:00
mut_visit.rs Expand NtExpr tokens only in key-value attributes 2020-11-03 00:53:43 +03:00
node_id.rs
ptr.rs
token.rs Suggest expressions that look like const generic arguments should be enclosed in brackets 2020-10-26 21:54:45 +00:00
tokenstream.rs Expand NtExpr tokens only in key-value attributes 2020-11-03 00:53:43 +03:00
visit.rs Expand NtExpr tokens only in key-value attributes 2020-11-03 00:53:43 +03:00