diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-12-07 18:55:00 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2021-01-28 08:51:43 -0500 |
| commit | f9025512e7fd91684a27c7b7aef31f20a01092af (patch) | |
| tree | 569a94a5b18a0fc7d6e1daf0d6476623c7cf2cc6 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 0e190206e2ff0c13d64701d9b4145bf89a2d0cab (diff) | |
| download | rust-f9025512e7fd91684a27c7b7aef31f20a01092af.tar.gz rust-f9025512e7fd91684a27c7b7aef31f20a01092af.zip | |
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(semicolon_in_expressions_from_macros)]`.
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/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
