]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/redundant-semicolon/redundant-semi-proc-macro.rs
Rollup merge of #106707 - ehuss:remove-dupe-sha-1, r=Mark-Simulacrum
[rust.git] / tests / ui / lint / redundant-semicolon / redundant-semi-proc-macro.rs
1 // aux-build:redundant-semi-proc-macro-def.rs
2
3 #![deny(redundant_semicolons)]
4 extern crate redundant_semi_proc_macro;
5 use redundant_semi_proc_macro::should_preserve_spans;
6
7 #[should_preserve_spans]
8 fn span_preservation()  {
9     let tst = 123;; //~ ERROR unnecessary trailing semicolon
10     match tst {
11         // Redundant semicolons are parsed as empty tuple exprs
12         // for the lint, so ensure the lint doesn't affect
13         // empty tuple exprs explicitly in source.
14         123 => (),
15         _ => ()
16     };;; //~ ERROR unnecessary trailing semicolons
17 }
18
19 fn main() {}