about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/Linker.cpp
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-01-29 09:17:26 +0900
committerGitHub <noreply@github.com>2021-01-29 09:17:26 +0900
commit4003a7397505ddfe3460e52b9dd7666ac785ed38 (patch)
tree9056d7ee4ea522ee038488b5cca3948a4b48faf8 /compiler/rustc_llvm/llvm-wrapper/Linker.cpp
parentd9e56f48c5ed6d40fff4e3277735df605e143791 (diff)
parentf9025512e7fd91684a27c7b7aef31f20a01092af (diff)
downloadrust-4003a7397505ddfe3460e52b9dd7666ac785ed38.tar.gz
rust-4003a7397505ddfe3460e52b9dd7666ac785ed38.zip
Rollup merge of #79819 - Aaron1011:feature/macro-trailing-semicolon, r=petrochenkov
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint

cc #79813

This PR adds an allow-by-default future-compatibility lint
`SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a
macro body is ignored due to the macro being used in expression
position:

```rust
macro_rules! foo {
    () => {
        true; // WARN
    }
}

fn main() {
    let val = match true {
        true => false,
        _ => foo!()
    };
}
```

The lint takes its level from the macro call site, and
can be allowed for a particular macro by adding
`#[allow(macro_trailing_semicolon)]`.

The lint is set to warn for all internal rustc crates (when being built
by a stage1 compiler). After the next beta bump, we can enable
the lint for the bootstrap compiler as well.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions