]> git.lizzy.rs Git - rust.git/commitdiff
Update tests for excess semicolon lint
authorNathan <nathan.whitaker01@gmail.com>
Tue, 30 Jul 2019 17:52:32 +0000 (13:52 -0400)
committernathanwhit <nathan.whitaker01@gmail.com>
Mon, 12 Aug 2019 14:14:07 +0000 (10:14 -0400)
src/test/ui/block-expr-precedence.stderr [new file with mode: 0644]
src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr
src/test/ui/parser/doc-before-semi.rs
src/test/ui/parser/doc-before-semi.stderr
src/test/ui/proc-macro/span-preservation.rs
src/test/ui/proc-macro/span-preservation.stderr

diff --git a/src/test/ui/block-expr-precedence.stderr b/src/test/ui/block-expr-precedence.stderr
new file mode 100644 (file)
index 0000000..1307b5d
--- /dev/null
@@ -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
+
index f1c93d546376758e706e867feef0d9b18d972485..f5edbe2a3af531b41ef7d0b9d44bdd5d249ac9a2 100644 (file)
@@ -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
index 405a7e1e2a33b9eca931dfe4b53b87cd884f2e25..c3f478fe4207757f11efb0d2669a1b7b18ce48c2 100644 (file)
@@ -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
 }
index e6bade18d0a2da70c392493f5fe8656a6742782d..b9ac30b09b2f866ae433ca82709e6146a8008da9 100644 (file)
@@ -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`.
index 0a82d28e9e544f830964545c26fc85348233effd..55835cb88f4e307c60789ca3506ed89ddb649d92 100644 (file)
@@ -9,7 +9,7 @@
 
 #[recollect_attr]
 fn a() {
-    let x: usize = "hello";;;;; //~ ERROR mismatched types
+    let x: usize = "hello"; //~ ERROR mismatched types
 }
 
 #[recollect_attr]
index cf03deee7e44554dd2003cfe1a7a723f156c8f01..0290f4b2cc98259377d9c6e0228906291933ed12 100644 (file)
@@ -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`