Skip to content

Commit

Permalink
Update tests for excess semicolon lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwhit committed Aug 12, 2019
1 parent 2f6cb5f commit 76a1345
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/test/ui/block-expr-precedence.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
warning: unnecessary trailing semicolons
--> $DIR/block-expr-precedence.rs:60:21
|
LL | if (true) { 12; };;; -num;
| ^^ help: remove these semicolons
|
= note: `#[warn(redundant_semicolon)]` on by default

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ error: expected `{`, found `;`
LL | if not // lack of braces is [sic]
| -- this `if` statement has a condition, but no block
LL | println!("Then when?");
| ^ expected `{`
| ^
| |
| expected `{`
| help: try placing this code inside a block: `{ ; }`

error: unexpected `2` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:26:24
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/parser/doc-before-semi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ fn main() {
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
;
//~^ WARNING unnecessary trailing semicolon
//~| HELP remove this semicolon
}
8 changes: 8 additions & 0 deletions src/test/ui/parser/doc-before-semi.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ LL | /// hi
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?

warning: unnecessary trailing semicolon
--> $DIR/doc-before-semi.rs:5:5
|
LL | ;
| ^ help: remove this semicolon
|
= note: `#[warn(redundant_semicolon)]` on by default

error: aborting due to previous error

For more information about this error, try `rustc --explain E0585`.
2 changes: 1 addition & 1 deletion src/test/ui/proc-macro/span-preservation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extern crate test_macros;

#[recollect_attr]
fn a() {
let x: usize = "hello";;;;; //~ ERROR mismatched types
let x: usize = "hello"; //~ ERROR mismatched types
}

#[recollect_attr]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/proc-macro/span-preservation.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ error[E0308]: mismatched types
error[E0308]: mismatched types
--> $DIR/span-preservation.rs:12:20
|
LL | let x: usize = "hello";;;;;
LL | let x: usize = "hello";
| ^^^^^^^ expected usize, found reference
|
= note: expected type `usize`
Expand Down

0 comments on commit 76a1345

Please sign in to comment.