Add test suggest-remove-semi-in-macro-expansion-issue-142143.rs
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
parent
55d436467c
commit
1ab8ff57d6
2 changed files with 29 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
// Make sure we don't suggest remove redundant semicolon inside macro expansion.(issue #142143)
|
||||
|
||||
#![deny(redundant_semicolons)]
|
||||
|
||||
macro_rules! m {
|
||||
($stmt:stmt) => { #[allow(bad_style)] $stmt } //~ ERROR unnecessary trailing semicolon [redundant_semicolons]
|
||||
}
|
||||
|
||||
fn main() {
|
||||
m!(;);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
error: unnecessary trailing semicolon
|
||||
--> $DIR/suggest-remove-semi-in-macro-expansion-issue-142143.rs:6:43
|
||||
|
|
||||
LL | ($stmt:stmt) => { #[allow(bad_style)] $stmt }
|
||||
| ^^^^^ help: remove this semicolon
|
||||
...
|
||||
LL | m!(;);
|
||||
| ----- in this macro invocation
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/suggest-remove-semi-in-macro-expansion-issue-142143.rs:3:9
|
||||
|
|
||||
LL | #![deny(redundant_semicolons)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue