Skip to content

Commit 76a1345

Browse files
committed
Update tests for excess semicolon lint
1 parent 2f6cb5f commit 76a1345

6 files changed

+24
-3
lines changed
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: unnecessary trailing semicolons
2+
--> $DIR/block-expr-precedence.rs:60:21
3+
|
4+
LL | if (true) { 12; };;; -num;
5+
| ^^ help: remove these semicolons
6+
|
7+
= note: `#[warn(redundant_semicolon)]` on by default
8+

src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ error: expected `{`, found `;`
2828
LL | if not // lack of braces is [sic]
2929
| -- this `if` statement has a condition, but no block
3030
LL | println!("Then when?");
31-
| ^ expected `{`
31+
| ^
32+
| |
33+
| expected `{`
34+
| help: try placing this code inside a block: `{ ; }`
3235

3336
error: unexpected `2` after identifier
3437
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:26:24

src/test/ui/parser/doc-before-semi.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ fn main() {
33
//~^ ERROR found a documentation comment that doesn't document anything
44
//~| HELP maybe a comment was intended
55
;
6+
//~^ WARNING unnecessary trailing semicolon
7+
//~| HELP remove this semicolon
68
}

src/test/ui/parser/doc-before-semi.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ LL | /// hi
66
|
77
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
88

9+
warning: unnecessary trailing semicolon
10+
--> $DIR/doc-before-semi.rs:5:5
11+
|
12+
LL | ;
13+
| ^ help: remove this semicolon
14+
|
15+
= note: `#[warn(redundant_semicolon)]` on by default
16+
917
error: aborting due to previous error
1018

1119
For more information about this error, try `rustc --explain E0585`.

src/test/ui/proc-macro/span-preservation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern crate test_macros;
99

1010
#[recollect_attr]
1111
fn a() {
12-
let x: usize = "hello";;;;; //~ ERROR mismatched types
12+
let x: usize = "hello"; //~ ERROR mismatched types
1313
}
1414

1515
#[recollect_attr]

src/test/ui/proc-macro/span-preservation.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ error[E0308]: mismatched types
66
error[E0308]: mismatched types
77
--> $DIR/span-preservation.rs:12:20
88
|
9-
LL | let x: usize = "hello";;;;;
9+
LL | let x: usize = "hello";
1010
| ^^^^^^^ expected usize, found reference
1111
|
1212
= note: expected type `usize`

0 commit comments

Comments
 (0)