about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-11-03 15:27:03 +0900
committerGitHub <noreply@github.com>2020-11-03 15:27:03 +0900
commit0716724a0b29269ba3b79abb65f1f0505e5bb0ec (patch)
treed9e9e635c41b6d29e9edf0c90ff7cf02e563d23e /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent4c0c5e099a3b1f1c6ad53115189c2710495588b3 (diff)
parente78e9d4a06192cfbb9e1417fdd7a0753d51684a3 (diff)
downloadrust-0716724a0b29269ba3b79abb65f1f0505e5bb0ec.tar.gz
rust-0716724a0b29269ba3b79abb65f1f0505e5bb0ec.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions