Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lint for excess trailing semicolons #62984

Merged
merged 3 commits into from
Aug 15, 2019

Conversation

nathanwhit
Copy link
Member

@nathanwhit nathanwhit commented Jul 25, 2019

Closes #60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:

fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}

The output is:

warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

@rust-highfive
Copy link
Collaborator

r? @varkor

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 25, 2019
@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-07-25T17:57:36.9718948Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-25T17:57:36.9917972Z ##[command]git config gc.auto 0
2019-07-25T17:57:37.0021529Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-25T17:57:37.0117833Z ##[command]git config --get-all http.proxy
2019-07-25T17:57:37.0273406Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/62984/merge:refs/remotes/pull/62984/merge
---
2019-07-25T17:58:13.2661424Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-25T17:58:13.2662651Z 
2019-07-25T17:58:13.2664278Z   git checkout -b <new-branch-name>
2019-07-25T17:58:13.2666058Z 
2019-07-25T17:58:13.2668261Z HEAD is now at 067db91dc Merge 2716d6d80386d4a111586b6a5d4493477596a692 into eedf6ce4ef54bb03818ab21d714f1b9f13a6b31c
2019-07-25T17:58:13.2819110Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-25T17:58:13.2822024Z ==============================================================================
2019-07-25T17:58:13.2822079Z Task         : Bash
2019-07-25T17:58:13.2822123Z Description  : Run a Bash script on macOS, Linux, or Windows

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-07-25T21:27:25.6526737Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-25T21:27:25.6724505Z ##[command]git config gc.auto 0
2019-07-25T21:27:25.6794394Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-25T21:27:25.6859051Z ##[command]git config --get-all http.proxy
2019-07-25T21:27:25.7006579Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/62984/merge:refs/remotes/pull/62984/merge
---
2019-07-25T21:28:00.2186918Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-25T21:28:00.2186982Z 
2019-07-25T21:28:00.2187279Z   git checkout -b <new-branch-name>
2019-07-25T21:28:00.2187497Z 
2019-07-25T21:28:00.2187552Z HEAD is now at 8647f7372 Merge 2bfed94a09a3117c730f6fa4e66b3c61f8db4976 into eedf6ce4ef54bb03818ab21d714f1b9f13a6b31c
2019-07-25T21:28:00.2354694Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-25T21:28:00.2358193Z ==============================================================================
2019-07-25T21:28:00.2358263Z Task         : Bash
2019-07-25T21:28:00.2358316Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-25T22:14:01.2118204Z    Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
2019-07-25T22:14:01.9976973Z error: unnecessary trailing semicolons
2019-07-25T22:14:01.9991837Z   --> src/librustc_typeck/structured_errors.rs:51:9
2019-07-25T22:14:01.9996967Z    |
2019-07-25T22:14:02.0014596Z 51 |         __diagnostic_used!(E0617);
2019-07-25T22:14:02.0018302Z    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these semicolons
2019-07-25T22:14:02.0019862Z    = note: `-D redundant-semicolon` implied by `-D warnings`
2019-07-25T22:14:02.0019937Z 
2019-07-25T22:14:02.0084024Z error: unnecessary trailing semicolons
2019-07-25T22:14:02.0085460Z    --> src/librustc_typeck/structured_errors.rs:107:9
2019-07-25T22:14:02.0085460Z    --> src/librustc_typeck/structured_errors.rs:107:9
2019-07-25T22:14:02.0088578Z     |
2019-07-25T22:14:02.0089347Z 107 |         __diagnostic_used!(E0607);
2019-07-25T22:14:02.0090077Z     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these semicolons
2019-07-25T22:14:05.6880456Z error: aborting due to 2 previous errors
2019-07-25T22:14:05.6880650Z 
2019-07-25T22:14:05.7468326Z error: Could not compile `rustc_typeck`.
2019-07-25T22:14:05.7479062Z warning: build failed, waiting for other jobs to finish...
2019-07-25T22:14:05.7479062Z warning: build failed, waiting for other jobs to finish...
2019-07-25T22:16:35.1530422Z error: build failed
2019-07-25T22:16:35.1569984Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
2019-07-25T22:16:35.1570622Z expected success, got: exit code: 101
2019-07-25T22:16:35.1574229Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-25T22:16:35.1574588Z Build completed unsuccessfully in 0:42:18
2019-07-25T22:16:36.9197219Z ##[error]Bash exited with code '1'.
2019-07-25T22:16:36.9230930Z ##[section]Starting: Checkout
2019-07-25T22:16:36.9233110Z ==============================================================================
2019-07-25T22:16:36.9233173Z Task         : Get sources
2019-07-25T22:16:36.9233240Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-07-26T04:37:59.5188285Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-26T04:38:00.4102207Z ##[command]git config gc.auto 0
2019-07-26T04:38:00.4105439Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-26T04:38:00.4108009Z ##[command]git config --get-all http.proxy
2019-07-26T04:38:00.4113920Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/62984/merge:refs/remotes/pull/62984/merge
---
2019-07-26T04:38:33.1870291Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-26T04:38:33.1870342Z 
2019-07-26T04:38:33.1870550Z   git checkout -b <new-branch-name>
2019-07-26T04:38:33.1870580Z 
2019-07-26T04:38:33.1870629Z HEAD is now at 8f9b513d9 Merge 919398063da344c697b5aa612366586da98a1071 into 18630677cf6c7ac50e6786c504b35bc09501dbe2
2019-07-26T04:38:33.2009486Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-26T04:38:33.2012564Z ==============================================================================
2019-07-26T04:38:33.2012616Z Task         : Bash
2019-07-26T04:38:33.2012657Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-26T05:38:11.6548744Z .................................................................................................... 200/5862
2019-07-26T05:38:15.8998012Z .................................................................................................... 300/5862
2019-07-26T05:38:19.5908033Z .................................................................................................... 400/5862
2019-07-26T05:38:23.3025380Z .................................................................................................... 500/5862
2019-07-26T05:38:27.0879419Z ........................................................................i........................... 600/5862
2019-07-26T05:38:36.0492421Z .................................................................................................... 800/5862
2019-07-26T05:38:41.6652325Z .................................................................................................... 900/5862
2019-07-26T05:38:46.7158692Z .................................................................................................... 1000/5862
2019-07-26T05:38:46.7158692Z .................................................................................................... 1000/5862
2019-07-26T05:38:52.2875023Z i...........i....................................................................................... 1100/5862
2019-07-26T05:38:56.1841130Z ..................F...........iiiii................................................................. 1200/5862
2019-07-26T05:39:02.2072710Z .................................................................................................... 1400/5862
2019-07-26T05:39:05.0010059Z .................................................................................................... 1500/5862
2019-07-26T05:39:08.7496791Z .................................................................................................... 1600/5862
2019-07-26T05:39:11.9324006Z .................................................................................................... 1700/5862
2019-07-26T05:39:11.9324006Z .................................................................................................... 1700/5862
2019-07-26T05:39:15.3482989Z ......................................................................i............................. 1800/5862
2019-07-26T05:39:23.9402631Z .................................................................................................... 2000/5862
2019-07-26T05:39:28.2716775Z .................................................................................................... 2100/5862
2019-07-26T05:39:32.0954542Z .................................................................................................... 2200/5862
2019-07-26T05:39:32.0954542Z .................................................................................................... 2200/5862
2019-07-26T05:39:35.9761238Z ......................................................i............................................. 2300/5862
2019-07-26T05:39:45.8115456Z .................................................................................................... 2500/5862
2019-07-26T05:39:50.0358641Z .................................................................................................... 2600/5862
2019-07-26T05:39:55.1935323Z .................................................................................................... 2700/5862
2019-07-26T05:39:59.0922590Z .................................................................................................... 2800/5862
2019-07-26T05:39:59.0922590Z .................................................................................................... 2800/5862
2019-07-26T05:40:03.5174903Z .................................................................................................... 2900/5862
2019-07-26T05:40:08.9541900Z .................................................................................................... 3000/5862
2019-07-26T05:40:13.3822858Z .................................................................................................... 3100/5862
2019-07-26T05:40:18.7200989Z .................................................................................................... 3200/5862
2019-07-26T05:40:22.2402315Z .................................................................................................... 3300/5862
2019-07-26T05:40:26.0054639Z .................................................................................................... 3400/5862
2019-07-26T05:40:31.1821845Z .................................................................................................... 3500/5862
2019-07-26T05:40:34.9064380Z .....................i.............................................................................. 3600/5862
2019-07-26T05:40:39.1828648Z .................................................................................................ii. 3700/5862
2019-07-26T05:40:42.9450040Z ..i..ii............................................................................................. 3800/5862
2019-07-26T05:40:51.6115192Z .................................................................................................... 4000/5862
2019-07-26T05:40:51.6115192Z .................................................................................................... 4000/5862
2019-07-26T05:40:55.6097483Z ................ii.................................................................................. 4100/5862
2019-07-26T05:40:57.6977822Z .....................................i...............F.............................................. 4200/5862
2019-07-26T05:40:59.7498446Z .................................................................................................... 4300/5862
2019-07-26T05:41:01.9744125Z ......i............................................................................................. 4400/5862
2019-07-26T05:41:23.9364024Z ..............................................................................F..................... 4600/5862
2019-07-26T05:41:27.6835155Z .................................................................................................... 4700/5862
2019-07-26T05:41:31.3708063Z .................................................................................................... 4800/5862
2019-07-26T05:41:36.1214837Z .................................................................................................... 4900/5862
---
2019-07-26T05:42:09.0540052Z .................................................................................................... 5500/5862
2019-07-26T05:42:13.4914585Z .................................................................................................... 5600/5862
2019-07-26T05:42:16.6060176Z .................................................................................................... 5700/5862
2019-07-26T05:42:19.7013612Z .................................................................................................... 5800/5862
2019-07-26T05:42:21.8845044Z ..i...........................................................
2019-07-26T05:42:21.8889334Z 
2019-07-26T05:42:21.8890299Z ---- [ui] ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.rs stdout ----
2019-07-26T05:42:21.8890360Z diff of stderr:
2019-07-26T05:42:21.8890495Z 
2019-07-26T05:42:21.8890495Z 
2019-07-26T05:42:21.8890536Z 28 LL |     if not  // lack of braces is [sic]
2019-07-26T05:42:21.8890773Z 29    |     -- this `if` statement has a condition, but no block
2019-07-26T05:42:21.8890840Z 30 LL |         println!("Then when?");
2019-07-26T05:42:21.8891046Z -    |                               ^ expected `{`
2019-07-26T05:42:21.8891164Z +    |                               |
2019-07-26T05:42:21.8891208Z +    |                               expected `{`
2019-07-26T05:42:21.8891208Z +    |                               expected `{`
2019-07-26T05:42:21.8891256Z +    |                               help: try placing this code inside a block: `{ ; }`
2019-07-26T05:42:21.8891318Z 32 
2019-07-26T05:42:21.8891362Z 33 error: unexpected `2` after identifier
2019-07-26T05:42:21.8891632Z 
2019-07-26T05:42:21.8891674Z 
2019-07-26T05:42:21.8891716Z The actual stderr differed from the expected stderr.
2019-07-26T05:42:21.8892052Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation/issue-46836-identifier-not-instead-of-negation.stderr
2019-07-26T05:42:21.8892052Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation/issue-46836-identifier-not-instead-of-negation.stderr
2019-07-26T05:42:21.8892293Z To update references, rerun the tests and pass the `--bless` flag
2019-07-26T05:42:21.8892565Z To only update this specific test, also pass `--test-args did_you_mean/issue-46836-identifier-not-instead-of-negation.rs`
2019-07-26T05:42:21.8892665Z error: 1 errors occurred comparing output.
2019-07-26T05:42:21.8892706Z status: exit code: 1
2019-07-26T05:42:21.8892706Z status: exit code: 1
2019-07-26T05:42:21.8893611Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation/auxiliary" "-A" "unused"
2019-07-26T05:42:21.8894151Z ------------------------------------------
2019-07-26T05:42:21.8894203Z 
2019-07-26T05:42:21.8894404Z ------------------------------------------
2019-07-26T05:42:21.8894447Z stderr:
2019-07-26T05:42:21.8894447Z stderr:
2019-07-26T05:42:21.8894639Z ------------------------------------------
2019-07-26T05:42:21.8894708Z error: unexpected `for_you` after identifier
2019-07-26T05:42:21.8895008Z    |
2019-07-26T05:42:21.8895008Z    |
2019-07-26T05:42:21.8895078Z LL |     if not for_you {
2019-07-26T05:42:21.8895307Z    |        |
2019-07-26T05:42:21.8895307Z    |        |
2019-07-26T05:42:21.8895371Z    |        help: use `!` to perform logical negation
2019-07-26T05:42:21.8895400Z 
2019-07-26T05:42:21.8895441Z error: unexpected `the_worst` after identifier
2019-07-26T05:42:21.8896171Z    |
2019-07-26T05:42:21.8896215Z LL |     while not the_worst {
2019-07-26T05:42:21.8896597Z    |           ----^^^^^^^^^
2019-07-26T05:42:21.8896667Z    |           |
2019-07-26T05:42:21.8896667Z    |           |
2019-07-26T05:42:21.8896716Z    |           help: use `!` to perform logical negation
2019-07-26T05:42:21.8896747Z 
2019-07-26T05:42:21.8896809Z error: unexpected `println` after identifier
2019-07-26T05:42:21.8900309Z    |
2019-07-26T05:42:21.8900309Z    |
2019-07-26T05:42:21.8900367Z LL |     if not  // lack of braces is [sic]
2019-07-26T05:42:21.8900629Z    |        ----- help: use `!` to perform logical negation
2019-07-26T05:42:21.8900678Z LL |         println!("Then when?");
2019-07-26T05:42:21.8900768Z 
2019-07-26T05:42:21.8900768Z 
2019-07-26T05:42:21.8900807Z error: expected `{`, found `;`
2019-07-26T05:42:21.8901125Z    |
2019-07-26T05:42:21.8901125Z    |
2019-07-26T05:42:21.8901177Z LL |     if not  // lack of braces is [sic]
2019-07-26T05:42:21.8901391Z    |     -- this `if` statement has a condition, but no block
2019-07-26T05:42:21.8901439Z LL |         println!("Then when?");
2019-07-26T05:42:21.8901542Z    |                               |
2019-07-26T05:42:21.8901585Z    |                               expected `{`
2019-07-26T05:42:21.8901585Z    |                               expected `{`
2019-07-26T05:42:21.8901653Z    |                               help: try placing this code inside a block: `{ ; }`
2019-07-26T05:42:21.8901692Z 
2019-07-26T05:42:21.8901733Z error: unexpected `2` after identifier
2019-07-26T05:42:21.8902053Z    |
2019-07-26T05:42:21.8902093Z LL |     let resource = not 2;
2019-07-26T05:42:21.8902279Z    |                    ----^
2019-07-26T05:42:21.8902342Z    |                    |
2019-07-26T05:42:21.8902342Z    |                    |
2019-07-26T05:42:21.8902387Z    |                    help: use `!` to perform logical negation
2019-07-26T05:42:21.8902425Z 
2019-07-26T05:42:21.8902486Z error: unexpected `be_smothered_out_before` after identifier
2019-07-26T05:42:21.8902826Z    |
2019-07-26T05:42:21.8902826Z    |
2019-07-26T05:42:21.8902871Z LL |     let young_souls = not be_smothered_out_before;
2019-07-26T05:42:21.8903299Z    |                       |
2019-07-26T05:42:21.8903299Z    |                       |
2019-07-26T05:42:21.8903358Z    |                       help: use `!` to perform logical negation
2019-07-26T05:42:21.8903456Z error: aborting due to 6 previous errors
2019-07-26T05:42:21.8903485Z 
2019-07-26T05:42:21.8903511Z 
2019-07-26T05:42:21.8903786Z ------------------------------------------
2019-07-26T05:42:21.8903786Z ------------------------------------------
2019-07-26T05:42:21.8903818Z 
2019-07-26T05:42:21.8903844Z 
2019-07-26T05:42:21.8904063Z ---- [ui] ui/parser/doc-before-semi.rs stdout ----
2019-07-26T05:42:21.8904139Z diff of stderr:
2019-07-26T05:42:21.8904168Z 
2019-07-26T05:42:21.8904208Z 6    |
2019-07-26T05:42:21.8904258Z 7    = help: doc comments must come before what they document, maybe a comment was intended with `//`?
2019-07-26T05:42:21.8904367Z + warning: unnecessary trailing semicolon
2019-07-26T05:42:21.8904584Z +   --> $DIR/doc-before-semi.rs:5:5
2019-07-26T05:42:21.8904648Z +    |
2019-07-26T05:42:21.8904689Z + LL |     ;
2019-07-26T05:42:21.8904689Z + LL |     ;
2019-07-26T05:42:21.8904742Z +    |     ^ help: remove this semicolon
2019-07-26T05:42:21.8904783Z +    |
2019-07-26T05:42:21.8904847Z +    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-26T05:42:21.8904933Z 9 error: aborting due to previous error
2019-07-26T05:42:21.8904993Z 10 
2019-07-26T05:42:21.8905239Z 11 For more information about this error, try `rustc --explain E0585`.
2019-07-26T05:42:21.8905274Z 
2019-07-26T05:42:21.8905274Z 
2019-07-26T05:42:21.8905300Z 
2019-07-26T05:42:21.8905363Z The actual stderr differed from the expected stderr.
2019-07-26T05:42:21.8906667Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/doc-before-semi/doc-before-semi.stderr
2019-07-26T05:42:21.8906925Z To update references, rerun the tests and pass the `--bless` flag
2019-07-26T05:42:21.8907214Z To only update this specific test, also pass `--test-args parser/doc-before-semi.rs`
2019-07-26T05:42:21.8907299Z error: 1 errors occurred comparing output.
2019-07-26T05:42:21.8907364Z status: exit code: 1
2019-07-26T05:42:21.8907364Z status: exit code: 1
2019-07-26T05:42:21.8908090Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/parser/doc-before-semi.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/doc-before-semi" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/doc-before-semi/auxiliary" "-A" "unused"
2019-07-26T05:42:21.8908426Z ------------------------------------------
2019-07-26T05:42:21.8908462Z 
2019-07-26T05:42:21.8908674Z ------------------------------------------
2019-07-26T05:42:21.8908739Z stderr:
2019-07-26T05:42:21.8908739Z stderr:
2019-07-26T05:42:21.8908950Z ------------------------------------------
2019-07-26T05:42:21.8909194Z error[E0585]: found a documentation comment that doesn't document anything
2019-07-26T05:42:21.8909812Z   --> /checkout/src/test/ui/parser/doc-before-semi.rs:2:5
2019-07-26T05:42:21.8909861Z    |
2019-07-26T05:42:21.8909901Z LL |     /// hi
2019-07-26T05:42:21.8909959Z    |     ^^^^^^
2019-07-26T05:42:21.8909997Z    |
2019-07-26T05:42:21.8910045Z    = help: doc comments must come before what they document, maybe a comment was intended with `//`?
2019-07-26T05:42:21.8910141Z warning: unnecessary trailing semicolon
2019-07-26T05:42:21.8910367Z   --> /checkout/src/test/ui/parser/doc-before-semi.rs:5:5
2019-07-26T05:42:21.8910410Z    |
2019-07-26T05:42:21.8910468Z LL |     ;
2019-07-26T05:42:21.8910468Z LL |     ;
2019-07-26T05:42:21.8910508Z    |     ^ help: remove this semicolon
2019-07-26T05:42:21.8910548Z    |
2019-07-26T05:42:21.8910608Z    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-26T05:42:21.8910679Z error: aborting due to previous error
2019-07-26T05:42:21.8910706Z 
2019-07-26T05:42:21.8911069Z For more information about this error, try `rustc --explain E0585`.
2019-07-26T05:42:21.8911112Z 
---
2019-07-26T05:42:21.8912147Z - error[E0308]: mismatched types
2019-07-26T05:42:21.8912197Z + warning: unnecessary trailing semicolon
2019-07-26T05:42:21.8912247Z 2    |
2019-07-26T05:42:21.8912443Z -    = note: expected type `()`
2019-07-26T05:42:21.8912843Z -               found type `{integer}`
2019-07-26T05:42:21.8912896Z +    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-26T05:42:21.8913002Z 6 error[E0308]: mismatched types
2019-07-26T05:42:21.8913214Z -   --> $DIR/span-preservation.rs:12:20
2019-07-26T05:42:21.8913260Z 8    |
2019-07-26T05:42:21.8913260Z 8    |
2019-07-26T05:42:21.8913481Z - LL |     let x: usize = "hello";;;;;
2019-07-26T05:42:21.8914250Z -    |
2019-07-26T05:42:21.8914294Z 12    = note: expected type `usize`
2019-07-26T05:42:21.8914564Z 13               found type `&'static str`
2019-07-26T05:42:21.8914608Z + 
2019-07-26T05:42:21.8914608Z + 
2019-07-26T05:42:21.8914648Z + error[E0308]: mismatched types
2019-07-26T05:42:21.8914709Z +    |
2019-07-26T05:42:21.8914748Z +    = note: expected type `()`
2019-07-26T05:42:21.8914792Z +               found type `{integer}`
2019-07-26T05:42:21.8914974Z 15 error[E0308]: mismatched types
2019-07-26T05:42:21.8917203Z 16   --> $DIR/span-preservation.rs:18:29
2019-07-26T05:42:21.8917256Z 
2019-07-26T05:42:21.8917307Z 
2019-07-26T05:42:21.8917307Z 
2019-07-26T05:42:21.8917360Z The actual stderr differed from the expected stderr.
2019-07-26T05:42:21.8917677Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/span-preservation/span-preservation.stderr
2019-07-26T05:42:21.8917957Z To update references, rerun the tests and pass the `--bless` flag
2019-07-26T05:42:21.8918231Z To only update this specific test, also pass `--test-args proc-macro/span-preservation.rs`
2019-07-26T05:42:21.8918312Z error: 1 errors occurred comparing output.
2019-07-26T05:42:21.8918376Z status: exit code: 1
2019-07-26T05:42:21.8918376Z status: exit code: 1
2019-07-26T05:42:21.8920401Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/proc-macro/span-preservation.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/span-preservation" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/span-preservation/auxiliary" "-A" "unused"
2019-07-26T05:42:21.8920820Z ------------------------------------------
2019-07-26T05:42:21.8920864Z 
2019-07-26T05:42:21.8921096Z ------------------------------------------
2019-07-26T05:42:21.8921142Z stderr:
2019-07-26T05:42:21.8921142Z stderr:
2019-07-26T05:42:21.8921343Z ------------------------------------------
2019-07-26T05:42:21.8921409Z warning: unnecessary trailing semicolon
2019-07-26T05:42:21.8921450Z    |
2019-07-26T05:42:21.8921495Z    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-26T05:42:21.8921587Z error[E0308]: mismatched types
2019-07-26T05:42:21.8921637Z    |
2019-07-26T05:42:21.8921678Z    = note: expected type `usize`
2019-07-26T05:42:21.8921905Z               found type `&'static str`
2019-07-26T05:42:21.8921905Z               found type `&'static str`
2019-07-26T05:42:21.8921937Z 
2019-07-26T05:42:21.8921978Z error[E0308]: mismatched types
2019-07-26T05:42:21.8922018Z    |
2019-07-26T05:42:21.8922078Z    = note: expected type `()`
2019-07-26T05:42:21.8922121Z               found type `{integer}`
2019-07-26T05:42:21.8922189Z error[E0308]: mismatched types
2019-07-26T05:42:21.8923734Z   --> /checkout/src/test/ui/proc-macro/span-preservation.rs:18:29
2019-07-26T05:42:21.8923841Z    |
2019-07-26T05:42:21.8923841Z    |
2019-07-26T05:42:21.8924160Z LL | fn b(x: Option<isize>) -> usize {
2019-07-26T05:42:21.8925294Z    |                           ----- expected `usize` because of return type
2019-07-26T05:42:21.8925353Z LL |     match x {
2019-07-26T05:42:21.8926362Z LL |         Some(x) => { return x }, //~ ERROR mismatched types
2019-07-26T05:42:21.8926459Z    |                             ^ expected usize, found isize
2019-07-26T05:42:21.8926547Z error[E0308]: mismatched types
2019-07-26T05:42:21.8926884Z   --> /checkout/src/test/ui/proc-macro/span-preservation.rs:34:22
2019-07-26T05:42:21.8926935Z    |
2019-07-26T05:42:21.8926935Z    |
2019-07-26T05:42:21.8926983Z LL |     let x = Foo { a: 10isize }; //~ ERROR mismatched types
2019-07-26T05:42:21.8927034Z    |                      ^^^^^^^ expected usize, found isize
2019-07-26T05:42:21.8927091Z 
2019-07-26T05:42:21.8927135Z error[E0560]: struct `c::Foo` has no field named `b`
2019-07-26T05:42:21.8927455Z    |
2019-07-26T05:42:21.8927455Z    |
2019-07-26T05:42:21.8927504Z LL |     let y = Foo { a: 10, b: 10isize }; //~ ERROR has no field named `b`
2019-07-26T05:42:21.8927558Z    |                          ^ `c::Foo` does not have this field
2019-07-26T05:42:21.8927664Z    = note: available fields are: `a`
2019-07-26T05:42:21.8927693Z 
2019-07-26T05:42:21.8927883Z error[E0308]: mismatched types
2019-07-26T05:42:21.8928174Z   --> /checkout/src/test/ui/proc-macro/span-preservation.rs:48:5
2019-07-26T05:42:21.8928174Z   --> /checkout/src/test/ui/proc-macro/span-preservation.rs:48:5
2019-07-26T05:42:21.8928223Z    |
2019-07-26T05:42:21.8928266Z LL | extern "C" fn baz() {
2019-07-26T05:42:21.8928514Z    |                     - possibly return type missing here?
2019-07-26T05:42:21.8928565Z LL |     0 //~ ERROR mismatched types
2019-07-26T05:42:21.8928611Z    |     ^ expected (), found integer
2019-07-26T05:42:21.8928712Z    = note: expected type `()`
2019-07-26T05:42:21.8928712Z    = note: expected type `()`
2019-07-26T05:42:21.8928765Z               found type `{integer}`
2019-07-26T05:42:21.8928856Z error: aborting due to 6 previous errors
2019-07-26T05:42:21.8928886Z 
2019-07-26T05:42:21.8928931Z Some errors have detailed explanations: E0308, E0560.
2019-07-26T05:42:21.8929173Z For more information about an error, try `rustc --explain E0308`.
---
2019-07-26T05:42:21.8930702Z test result: FAILED. 5838 passed; 3 failed; 21 ignored; 0 measured; 0 filtered out
2019-07-26T05:42:21.8930736Z 
2019-07-26T05:42:21.8930849Z 
2019-07-26T05:42:21.8930878Z 
2019-07-26T05:42:21.8932398Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-07-26T05:42:21.8932680Z 
2019-07-26T05:42:21.8932760Z 
2019-07-26T05:42:21.8933045Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:535:22
2019-07-26T05:42:21.8957233Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-07-26T05:42:21.8957233Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-07-26T05:42:21.8957311Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-26T05:42:21.8957362Z Build completed unsuccessfully in 0:57:23
2019-07-26T05:42:22.9887162Z ##[error]Bash exited with code '1'.
2019-07-26T05:42:22.9924597Z ##[section]Starting: Checkout
2019-07-26T05:42:22.9927187Z ==============================================================================
2019-07-26T05:42:22.9927262Z Task         : Get sources
2019-07-26T05:42:22.9927310Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@scottmcm
Copy link
Member

scottmcm commented Jul 28, 2019

            continue;;

I would expect this to still warn about the second semicolon.

(The first is technically unnecessary, since continue: !, but not "excess".)

@nathanwhit
Copy link
Member Author

            continue;;

I would expect this to still warn about the second semicolon.

(The first is technically unnecessary, since continue: !, but not "excess".)

Ah yeah that makes sense, it looks like I misinterpreted the discussion on the issue.
With the latest commit, it behaves as expected for those cases.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-07-29T18:15:22.3119123Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-29T18:15:22.3337320Z ##[command]git config gc.auto 0
2019-07-29T18:15:22.3424773Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-29T18:15:22.3477419Z ##[command]git config --get-all http.proxy
2019-07-29T18:15:22.3622612Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/62984/merge:refs/remotes/pull/62984/merge
---
2019-07-29T18:15:56.3734681Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-29T18:15:56.3735286Z 
2019-07-29T18:15:56.3736491Z   git checkout -b <new-branch-name>
2019-07-29T18:15:56.3737034Z 
2019-07-29T18:15:56.3738876Z HEAD is now at f5c378cc6 Merge 33d1bc567f73714244be55aca846ab7d71fc9af8 into 04b88a9eba8abbac87eddcb2998beea09589c2c9
2019-07-29T18:15:56.3891055Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-29T18:15:56.3893721Z ==============================================================================
2019-07-29T18:15:56.3893919Z Task         : Bash
2019-07-29T18:15:56.3893958Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-29T19:19:14.1387149Z .................................................................................................... 1400/8804
2019-07-29T19:19:20.3921964Z .................................................................................................... 1500/8804
2019-07-29T19:19:33.5916201Z ................................................................i...............i................... 1600/8804
2019-07-29T19:19:41.7114995Z .................................................................................................... 1700/8804
2019-07-29T19:19:56.8674975Z ..................................................iiiii............................................. 1800/8804
2019-07-29T19:20:08.6751472Z .................................................................................................... 2000/8804
2019-07-29T19:20:11.3865388Z .................................................................................................... 2100/8804
2019-07-29T19:20:15.6172087Z .................................................................................................... 2200/8804
2019-07-29T19:20:22.5739212Z .................................................................................................... 2300/8804
---
2019-07-29T19:24:18.6033524Z .................................................................................................... 5200/8804
2019-07-29T19:24:29.7517699Z .................................................................................................... 5300/8804
2019-07-29T19:24:37.7209645Z ..i................................................................................................. 5400/8804
2019-07-29T19:24:43.4043444Z .................................................................................................... 5500/8804
2019-07-29T19:24:56.3773358Z ................................................................................................ii.. 5600/8804
2019-07-29T19:25:11.7751539Z .i..ii...........i.................................................................................. 5700/8804
2019-07-29T19:25:27.5836128Z .................................................................................................... 5900/8804
2019-07-29T19:25:32.6321655Z ................................................................................................i..i 6000/8804
2019-07-29T19:25:47.5062869Z i................................................................................................... 6100/8804
2019-07-29T19:26:04.2556995Z .................................................................................................... 6200/8804
---
2019-07-29T19:30:22.3541140Z normalized stderr:
2019-07-29T19:30:22.3541211Z warning: unnecessary trailing semicolons
2019-07-29T19:30:22.3541428Z   --> $DIR/block-expr-precedence.rs:60:21
2019-07-29T19:30:22.3541469Z    |
2019-07-29T19:30:22.3541668Z LL |   if (true) { 12; };;; -num;
2019-07-29T19:30:22.3541714Z    |                     ^^ help: remove these semicolons
2019-07-29T19:30:22.3541753Z    |
2019-07-29T19:30:22.3541814Z    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-29T19:30:22.3541864Z 
2019-07-29T19:30:22.3541885Z 
2019-07-29T19:30:22.3541905Z 
2019-07-29T19:30:22.3542140Z The actual stderr differed from the expected stderr.
2019-07-29T19:30:22.3542140Z The actual stderr differed from the expected stderr.
2019-07-29T19:30:22.3542459Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-expr-precedence/block-expr-precedence.stderr
2019-07-29T19:30:22.3542669Z To update references, rerun the tests and pass the `--bless` flag
2019-07-29T19:30:22.3542912Z To only update this specific test, also pass `--test-args block-expr-precedence.rs`
2019-07-29T19:30:22.3543105Z error: 1 errors occurred comparing output.
2019-07-29T19:30:22.3543163Z status: exit code: 0
2019-07-29T19:30:22.3543163Z status: exit code: 0
2019-07-29T19:30:22.3543800Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/block-expr-precedence.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-expr-precedence/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-expr-precedence/auxiliary" "-A" "unused"
2019-07-29T19:30:22.3544080Z ------------------------------------------
2019-07-29T19:30:22.3544108Z 
2019-07-29T19:30:22.3544734Z ------------------------------------------
2019-07-29T19:30:22.3544789Z stderr:
2019-07-29T19:30:22.3544789Z stderr:
2019-07-29T19:30:22.3545029Z ------------------------------------------
2019-07-29T19:30:22.3545080Z warning: unnecessary trailing semicolons
2019-07-29T19:30:22.3545333Z   --> /checkout/src/test/ui/block-expr-precedence.rs:60:21
2019-07-29T19:30:22.3545383Z    |
2019-07-29T19:30:22.3545591Z LL |   if (true) { 12; };;; -num;
2019-07-29T19:30:22.3545662Z    |                     ^^ help: remove these semicolons
2019-07-29T19:30:22.3545707Z    |
2019-07-29T19:30:22.3545753Z    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-29T19:30:22.3545831Z 
2019-07-29T19:30:22.3546044Z ------------------------------------------
2019-07-29T19:30:22.3546076Z 
2019-07-29T19:30:22.3546111Z 
---
2019-07-29T19:30:22.3590128Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:533:22
2019-07-29T19:30:22.3590295Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-07-29T19:30:22.3609911Z 
2019-07-29T19:30:22.3613288Z 
2019-07-29T19:30:22.3618253Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-07-29T19:30:22.3618679Z 
2019-07-29T19:30:22.3618725Z 
2019-07-29T19:30:22.3618829Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-29T19:30:22.3618877Z Build completed unsuccessfully in 1:08:02
2019-07-29T19:30:22.3618877Z Build completed unsuccessfully in 1:08:02
2019-07-29T19:30:23.0965346Z ##[error]Bash exited with code '1'.
2019-07-29T19:30:23.1002730Z ##[section]Starting: Checkout
2019-07-29T19:30:23.1004315Z ==============================================================================
2019-07-29T19:30:23.1004363Z Task         : Get sources
2019-07-29T19:30:23.1004404Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-07-30T18:15:59.7729088Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-30T18:15:59.7896750Z ##[command]git config gc.auto 0
2019-07-30T18:15:59.7959516Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-30T18:16:00.3472139Z ##[command]git config --get-all http.proxy
2019-07-30T18:16:00.3477606Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/62984/merge:refs/remotes/pull/62984/merge
---
2019-07-30T18:16:34.3339972Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-30T18:16:34.3340016Z 
2019-07-30T18:16:34.3340196Z   git checkout -b <new-branch-name>
2019-07-30T18:16:34.3340395Z 
2019-07-30T18:16:34.3340438Z HEAD is now at 2bab48858 Merge 5423e88024eac9a7f5bda3d6a8cc8910c30225c7 into f690098e6d65ad7b33dc7fdefccc387806782027
2019-07-30T18:16:34.3489991Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-30T18:16:34.3492190Z ==============================================================================
2019-07-30T18:16:34.3492233Z Task         : Bash
2019-07-30T18:16:34.3492267Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-30T19:14:05.1984639Z .................................................................................................... 1400/8819
2019-07-30T19:14:10.7244880Z .................................................................................................... 1500/8819
2019-07-30T19:14:22.6302113Z ................................................................i...............i................... 1600/8819
2019-07-30T19:14:29.8463495Z .................................................................................................... 1700/8819
2019-07-30T19:14:43.8220217Z ..................................................iiiii............................................. 1800/8819
2019-07-30T19:14:54.3750728Z .................................................................................................... 2000/8819
2019-07-30T19:14:56.7086444Z .................................................................................................... 2100/8819
2019-07-30T19:15:00.0514002Z .................................................................................................... 2200/8819
2019-07-30T19:15:06.2923722Z .................................................................................................... 2300/8819
---
2019-07-30T19:18:46.7791112Z .................................................................................................... 5300/8819
2019-07-30T19:18:53.1333856Z ..............i..................................................................................... 5400/8819
2019-07-30T19:18:58.2300254Z .................................................................................................... 5500/8819
2019-07-30T19:19:09.5553572Z .................................................................................................... 5600/8819
2019-07-30T19:19:22.2732061Z ........ii...i..ii...........i...................................................................... 5700/8819
2019-07-30T19:19:36.9684058Z .................................................................................................... 5900/8819
2019-07-30T19:19:41.5182229Z .................................................................................................... 6000/8819
2019-07-30T19:19:41.5182229Z .................................................................................................... 6000/8819
2019-07-30T19:19:54.5023352Z ........i..ii....................................................................................... 6100/8819
2019-07-30T19:20:12.3465109Z ...................................................i................................................ 6300/8819
2019-07-30T19:20:14.3087790Z .................................................................................................... 6400/8819
2019-07-30T19:20:16.4613309Z .....................i.............................................................................. 6500/8819
2019-07-30T19:20:20.5803474Z .................................................................................................... 6600/8819
---
2019-07-30T19:24:01.4927480Z normalized stderr:
2019-07-30T19:24:01.4927528Z warning: unnecessary trailing semicolons
2019-07-30T19:24:01.4927818Z   --> $DIR/block-expr-precedence.rs:60:21
2019-07-30T19:24:01.4927865Z    |
2019-07-30T19:24:01.4928076Z LL |   if (true) { 12; };;; -num;
2019-07-30T19:24:01.4928145Z    |                     ^^ help: remove these semicolons
2019-07-30T19:24:01.4928192Z    |
2019-07-30T19:24:01.4928239Z    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-30T19:24:01.4928315Z 
2019-07-30T19:24:01.4928341Z 
2019-07-30T19:24:01.4928367Z 
2019-07-30T19:24:01.4928424Z The actual stderr differed from the expected stderr.
2019-07-30T19:24:01.4928424Z The actual stderr differed from the expected stderr.
2019-07-30T19:24:01.4928736Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-expr-precedence/block-expr-precedence.stderr
2019-07-30T19:24:01.4928999Z To update references, rerun the tests and pass the `--bless` flag
2019-07-30T19:24:01.4929252Z To only update this specific test, also pass `--test-args block-expr-precedence.rs`
2019-07-30T19:24:01.4929349Z error: 1 errors occurred comparing output.
2019-07-30T19:24:01.4929404Z status: exit code: 0
2019-07-30T19:24:01.4929404Z status: exit code: 0
2019-07-30T19:24:01.4930278Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/block-expr-precedence.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-expr-precedence/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-expr-precedence/auxiliary" "-A" "unused"
2019-07-30T19:24:01.4930566Z ------------------------------------------
2019-07-30T19:24:01.4930610Z 
2019-07-30T19:24:01.4930799Z ------------------------------------------
2019-07-30T19:24:01.4930839Z stderr:
2019-07-30T19:24:01.4930839Z stderr:
2019-07-30T19:24:01.4931020Z ------------------------------------------
2019-07-30T19:24:01.4931087Z warning: unnecessary trailing semicolons
2019-07-30T19:24:01.4931291Z   --> /checkout/src/test/ui/block-expr-precedence.rs:60:21
2019-07-30T19:24:01.4931334Z    |
2019-07-30T19:24:01.4931530Z LL |   if (true) { 12; };;; -num;
2019-07-30T19:24:01.4931574Z    |                     ^^ help: remove these semicolons
2019-07-30T19:24:01.4931611Z    |
2019-07-30T19:24:01.4931668Z    = note: `#[warn(redundant_semicolon)]` on by default
2019-07-30T19:24:01.4931717Z 
2019-07-30T19:24:01.4932057Z ------------------------------------------
2019-07-30T19:24:01.4932116Z 
2019-07-30T19:24:01.4932139Z 
---
2019-07-30T19:24:01.4959379Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:533:22
2019-07-30T19:24:01.4959623Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-07-30T19:24:01.4976410Z 
2019-07-30T19:24:01.4976507Z 
2019-07-30T19:24:01.4978652Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-07-30T19:24:01.4978949Z 
2019-07-30T19:24:01.4978999Z 
2019-07-30T19:24:01.4984706Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-30T19:24:01.4984771Z Build completed unsuccessfully in 1:01:31
2019-07-30T19:24:01.4984771Z Build completed unsuccessfully in 1:01:31
2019-07-30T19:24:02.1935335Z ##[error]Bash exited with code '1'.
2019-07-30T19:24:02.1973963Z ##[section]Starting: Checkout
2019-07-30T19:24:02.1975520Z ==============================================================================
2019-07-30T19:24:02.1975583Z Task         : Get sources
2019-07-30T19:24:02.1975623Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Jul 31, 2019

☔ The latest upstream changes (presumably #63148) made this pull request unmergeable. Please resolve the merge conflicts.

@wirelessringo
Copy link

Ping from triage. @varkor any updates on this?

@varkor
Copy link
Member

varkor commented Aug 11, 2019

@nathanwhit: I think this looks good, thanks! If you could rebase over master instead of merging, I'll approve the PR.

@nathanwhit
Copy link
Member Author

@varkor Just pushed the rebased version, so it should be good now. Thanks for the feedback on the changes!

@bors
Copy link
Contributor

bors commented Aug 12, 2019

☔ The latest upstream changes (presumably #63469) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC-zz
Copy link

@nathanwhit you have a conflict to resolve

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2019
@nathanwhit
Copy link
Member Author

Resolved the conflict and rebased, so it should be ready to merge now

@varkor
Copy link
Member

varkor commented Aug 13, 2019

@nathanwhit: thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 13, 2019

📌 Commit 76a1345 has been approved by varkor

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 13, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 14, 2019
Add lint for excess trailing semicolons

Closes rust-lang#60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:
```
fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}
```
The output is:
```
warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

```
Centril added a commit to Centril/rust that referenced this pull request Aug 14, 2019
Add lint for excess trailing semicolons

Closes rust-lang#60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:
```
fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}
```
The output is:
```
warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

```
Centril added a commit to Centril/rust that referenced this pull request Aug 14, 2019
Add lint for excess trailing semicolons

Closes rust-lang#60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:
```
fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}
```
The output is:
```
warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

```
bors added a commit that referenced this pull request Aug 14, 2019
Rollup of 10 pull requests

Successful merges:

 - #62984 (Add lint for excess trailing semicolons)
 - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`)
 - #63490 (libsyntax: cleanup and refactor `pat.rs`)
 - #63495 ( Remove redundant `ty` fields from `mir::Constant` and `hair::pattern::PatternRange`.)
 - #63509 (Point at the right enclosing scope when using `await` in non-async fn)
 - #63528 (syntax: Remove `DummyResult::expr_only`)
 - #63534 (Bump to 1.39)
 - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`)
 - #63542 (Add NodeId for Arm, Field and FieldPat)
 - #63560 (move test that shouldn't be in test/run-pass/)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Aug 14, 2019
Add lint for excess trailing semicolons

Closes rust-lang#60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:
```
fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}
```
The output is:
```
warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

```
Centril added a commit to Centril/rust that referenced this pull request Aug 14, 2019
Add lint for excess trailing semicolons

Closes rust-lang#60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:
```
fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}
```
The output is:
```
warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

```
bors added a commit that referenced this pull request Aug 15, 2019
Rollup of 11 pull requests

Successful merges:

 - #62984 (Add lint for excess trailing semicolons)
 - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`)
 - #63490 (libsyntax: cleanup and refactor `pat.rs`)
 - #63507 (When needing type annotations in local bindings, account for impl Trait and closures)
 - #63509 (Point at the right enclosing scope when using `await` in non-async fn)
 - #63528 (syntax: Remove `DummyResult::expr_only`)
 - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`)
 - #63542 (Add NodeId for Arm, Field and FieldPat)
 - #63543 (Merge Variant and Variant_)
 - #63560 (move test that shouldn't be in test/run-pass/)
 - #63570 (Adjust tracking issues for `MaybeUninit<T>` gates)

Failed merges:

r? @ghost
@bors bors merged commit 76a1345 into rust-lang:master Aug 15, 2019
@bors
Copy link
Contributor

bors commented Aug 15, 2019

☔ The latest upstream changes (presumably #63575) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 15, 2019
flip1995 added a commit to flip1995/rust-clippy that referenced this pull request Aug 15, 2019
Lint redundant_semicolon was added to rustc
@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 16, 2019

This broke the build of libc (due to deny(warnings)).

Applying the suggested fix - removing the "excess" trailing semicolon - fails with:

error: expected `;`, found `let fd = fd as usize;`
   --> ../src/macros.rs:131:15
    |
131 |             $($body)*
    |               ^^^^^ expected `;` here

So something is off with the lint, since the semicolon appears to be required.

@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 16, 2019

FWIW, this looks like the same pattern that I've raised with the clippy developers (e.g. see rust-lang/rust-clippy#3982). This PR adds a new lint, the lint tries to verify macros, but doesn't contain a single test using macros to try and break the lint. In my experience, most of these lints cannot work for macros, and it is better to just bail out from macros unless good macro tests are included.

@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 16, 2019

I spoke too soon, trying to find a reproducer, I wasn't able to break the lint, and rustc accepts the code without the semicolon just fine. The issue appears to be a different one, the syntex-syntax crate rejects the code without the semicolon. Can it be that support for writing this without the semicolon is recent ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add compiler warning for double semicolon
10 participants