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 and tests for unnecessary parens around types #65112

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

jack-t
Copy link
Contributor

@jack-t jack-t commented Oct 4, 2019

This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.

The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run tidy and rustfmt — I'm not totally sure it worked right, though — and I've tried to follow the instructions linked in the readme.

I tried to think through all the variants of ast::TyKind to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with dyn. I'm not a Rust expert, thought, so I may well be missing something.

There's also a problem with getting this to build. The new lint catches several things in the, e.g., core. Because x.py seems to build with an equivalent of -Werror, what would have been warnings cause the build to break. I got it to build and the tests to pass with --warnings warn on my x.py build and x.py test commands.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @zackmdavis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

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

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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-10-04T20:30:12.6914427Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-04T20:30:12.7150801Z ##[command]git config gc.auto 0
2019-10-04T20:30:12.7250151Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-04T20:30:12.7365531Z ##[command]git config --get-all http.proxy
2019-10-04T20:30:12.7519436Z ##[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/65112/merge:refs/remotes/pull/65112/merge
---
2019-10-04T21:02:25.9996977Z    Compiling hashbrown v0.5.0
2019-10-04T21:02:27.9570623Z error: unnecessary parentheses around type
2019-10-04T21:02:27.9575933Z     --> src/libstd/collections/hash/map.rs:1821:34
2019-10-04T21:02:27.9576791Z      |
2019-10-04T21:02:27.9577477Z 1821 |     fn next(&mut self) -> Option<(&'a K)> {
2019-10-04T21:02:27.9578361Z      |                                  ^^^^^^^ help: remove these parentheses
2019-10-04T21:02:27.9579967Z      = note: `-D unused-parens` implied by `-D warnings`
2019-10-04T21:02:27.9580186Z 
2019-10-04T21:02:27.9580818Z error: unnecessary parentheses around type
2019-10-04T21:02:27.9581391Z     --> src/libstd/collections/hash/map.rs:1844:34
2019-10-04T21:02:27.9581391Z     --> src/libstd/collections/hash/map.rs:1844:34
2019-10-04T21:02:27.9581799Z      |
2019-10-04T21:02:27.9582417Z 1844 |     fn next(&mut self) -> Option<(&'a V)> {
2019-10-04T21:02:27.9582976Z      |                                  ^^^^^^^ help: remove these parentheses
2019-10-04T21:02:27.9583614Z error: unnecessary parentheses around type
2019-10-04T21:02:27.9584059Z     --> src/libstd/collections/hash/map.rs:1867:34
2019-10-04T21:02:27.9584656Z      |
2019-10-04T21:02:27.9584656Z      |
2019-10-04T21:02:27.9585170Z 1867 |     fn next(&mut self) -> Option<(&'a mut V)> {
2019-10-04T21:02:27.9585749Z      |                                  ^^^^^^^^^^^ help: remove these parentheses
2019-10-04T21:02:30.4229412Z error: aborting due to 3 previous errors
2019-10-04T21:02:30.4230314Z 
2019-10-04T21:02:30.4890829Z error: could not compile `std`.
2019-10-04T21:02:30.4892149Z 
---
2019-10-04T21:02:30.5001794Z == clock drift check ==
2019-10-04T21:02:30.5019168Z   local time: Fri Oct  4 21:02:30 UTC 2019
2019-10-04T21:02:30.6665126Z   network time: Fri, 04 Oct 2019 21:02:30 GMT
2019-10-04T21:02:30.6669901Z == end clock drift check ==
2019-10-04T21:02:33.4173755Z ##[error]Bash exited with code '1'.
2019-10-04T21:02:33.4228261Z ##[section]Starting: Checkout
2019-10-04T21:02:33.4230257Z ==============================================================================
2019-10-04T21:02:33.4230308Z Task         : Get sources
2019-10-04T21:02:33.4230367Z 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)

@zackmdavis
Copy link
Member

@jack-t Thanks! You can edit libcore/ and libstd/ as part of this PR. (It should be fine to remove those parens in Option<(&'a K)>, &c.)

@zackmdavis
Copy link
Member

(And, of course, if you find any cases that aren't fine to remove; that would be a bug in your lint change; I'll do my own audit of the TyKind variants once we have this building.)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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-10-07T14:07:59.4287802Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-07T14:07:59.4453052Z ##[command]git config gc.auto 0
2019-10-07T14:07:59.4532462Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-07T14:07:59.4588796Z ##[command]git config --get-all http.proxy
2019-10-07T14:07:59.4740782Z ##[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/65112/merge:refs/remotes/pull/65112/merge
---
2019-10-07T14:41:01.9541939Z    Compiling rls-data v0.19.0
2019-10-07T14:41:11.2086414Z    Compiling synstructure v0.12.1
2019-10-07T14:41:47.2521278Z    Compiling rand v0.7.0
2019-10-07T14:41:50.8461096Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-10-07T14:41:51.0412595Z error: unnecessary parentheses around type
2019-10-07T14:41:51.0413895Z   --> src/librustc_data_structures/graph/scc/mod.rs:40:24
2019-10-07T14:41:51.0414883Z    |
2019-10-07T14:41:51.0415820Z 40 |     pub fn new(graph: &(impl DirectedGraph<Node = N> + WithNumNodes + WithSuccessors)) -> Self {
2019-10-07T14:41:51.0416531Z    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
2019-10-07T14:41:51.0417556Z    = note: `-D unused-parens` implied by `-D warnings`
2019-10-07T14:41:51.0421007Z 
2019-10-07T14:41:51.0462072Z error: unnecessary parentheses around type
2019-10-07T14:41:51.0462692Z     --> src/librustc_data_structures/owning_ref/mod.rs:1049:28
2019-10-07T14:41:51.0462692Z     --> src/librustc_data_structures/owning_ref/mod.rs:1049:28
2019-10-07T14:41:51.0463133Z      |
2019-10-07T14:41:51.0463621Z 1049 |     where O: Send, for<'a> (&'a T): Send {}
2019-10-07T14:41:51.0464413Z      |                            ^^^^^^^ help: remove these parentheses
2019-10-07T14:41:51.0497995Z error: unnecessary parentheses around type
2019-10-07T14:41:51.0498647Z     --> src/librustc_data_structures/owning_ref/mod.rs:1051:28
2019-10-07T14:41:51.0499065Z      |
2019-10-07T14:41:51.0499065Z      |
2019-10-07T14:41:51.0499522Z 1051 |     where O: Sync, for<'a> (&'a T): Sync {}
2019-10-07T14:41:51.0500063Z      |                            ^^^^^^^ help: remove these parentheses
2019-10-07T14:41:51.0542274Z error: unnecessary parentheses around type
2019-10-07T14:41:51.0543342Z     --> src/librustc_data_structures/owning_ref/mod.rs:1054:28
2019-10-07T14:41:51.0543796Z      |
2019-10-07T14:41:51.0543796Z      |
2019-10-07T14:41:51.0545761Z 1054 |     where O: Send, for<'a> (&'a mut T): Send {}
2019-10-07T14:41:51.0546132Z      |                            ^^^^^^^^^^^ help: remove these parentheses
2019-10-07T14:41:51.0581229Z error: unnecessary parentheses around type
2019-10-07T14:41:51.0581562Z     --> src/librustc_data_structures/owning_ref/mod.rs:1056:28
2019-10-07T14:41:51.0581784Z      |
2019-10-07T14:41:51.0581784Z      |
2019-10-07T14:41:51.0582095Z 1056 |     where O: Sync, for<'a> (&'a mut T): Sync {}
2019-10-07T14:41:51.0582504Z      |                            ^^^^^^^^^^^ help: remove these parentheses
2019-10-07T14:41:51.9470741Z error: aborting due to 5 previous errors
2019-10-07T14:41:51.9475238Z 
2019-10-07T14:41:51.9679223Z error: could not compile `rustc_data_structures`.
2019-10-07T14:41:51.9703183Z warning: build failed, waiting for other jobs to finish...
---
2019-10-07T14:41:58.8124025Z == clock drift check ==
2019-10-07T14:41:58.8155131Z   local time: Mon Oct  7 14:41:58 UTC 2019
2019-10-07T14:41:58.9709670Z   network time: Mon, 07 Oct 2019 14:41:58 GMT
2019-10-07T14:41:58.9709798Z == end clock drift check ==
2019-10-07T14:42:00.0702027Z ##[error]Bash exited with code '1'.
2019-10-07T14:42:00.0752846Z ##[section]Starting: Checkout
2019-10-07T14:42:00.0754993Z ==============================================================================
2019-10-07T14:42:00.0755047Z Task         : Get sources
2019-10-07T14:42:00.0755114Z 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)

@JohnCSimon JohnCSimon 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 Oct 12, 2019
@JohnCSimon
Copy link
Member

Ping from triage
@jack-t can you please address the comments from @zackmdavis
thanks

@jack-t
Copy link
Contributor Author

jack-t commented Oct 19, 2019

Thanks for following up on this, @JohnCSimon -- I had a few papers to write this week, which really bogged me down.

I'm hoping the commit I just added to this PR will get the lint right.

The last version incorrectly warned that the parentheses in, e.g., &(impl Display + Sized) were unnecessary. I've done some experimenting, and I've found that the parentheses are indeed unnecessary in &(impl Display). The version I've just committed accounts for that.

I've gone through all the variants in ast::TyKind (see here), but I'm still not quite sure my conditions for raising the warning are exactly right. I would appreciate your or @zackmdavis 's help on that.


Separately, I found that this syntax is pretty much undocumented:

impl<T> Trait<T> for Struct<T> 
    where for<'a> &'a T: OtherTrait {
    // ...
}

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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-10-19T06:33:14.4827252Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-19T06:33:14.5042040Z ##[command]git config gc.auto 0
2019-10-19T06:33:14.5139531Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-19T06:33:14.5219455Z ##[command]git config --get-all http.proxy
2019-10-19T06:33:14.5380780Z ##[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/65112/merge:refs/remotes/pull/65112/merge
---
2019-10-19T07:39:57.7825949Z .................................................................................................... 1600/9198
2019-10-19T07:40:03.2626628Z .................................................................................................... 1700/9198
2019-10-19T07:40:17.0204126Z .............................i...............i...................................................... 1800/9198
2019-10-19T07:40:24.8703153Z .................................................................................................... 1900/9198
2019-10-19T07:40:40.2707045Z ...................iiiii............................................................................ 2000/9198
2019-10-19T07:40:51.3545086Z .................................................................................................... 2200/9198
2019-10-19T07:40:54.0320530Z .................................................................................................... 2300/9198
2019-10-19T07:40:59.7236790Z .................................................................................................... 2400/9198
2019-10-19T07:41:23.4485631Z .................................................................................................... 2500/9198
---
2019-10-19T07:44:29.8943044Z ......................i...............i............................................................. 4800/9198
2019-10-19T07:44:42.3474707Z .................................................................................................... 4900/9198
2019-10-19T07:44:49.0280857Z .................................................................................................... 5000/9198
2019-10-19T07:44:59.9428739Z .................................................................................................... 5100/9198
2019-10-19T07:45:06.7080061Z ......................ii.ii......................................................................... 5200/9198
2019-10-19T07:45:17.8183097Z .................................................................................................... 5400/9198
2019-10-19T07:45:28.4671902Z ........................................................................................i........... 5500/9198
2019-10-19T07:45:37.0476589Z .................................................................................................... 5600/9198
2019-10-19T07:45:42.4645699Z .................................................................................................... 5700/9198
2019-10-19T07:45:42.4645699Z .................................................................................................... 5700/9198
2019-10-19T07:45:53.6904680Z .....................................................................................ii...i..ii..... 5800/9198
2019-10-19T07:46:21.3460390Z .................................................................................................... 6000/9198
2019-10-19T07:46:31.3916846Z .................................................................................................... 6100/9198
2019-10-19T07:46:41.0209742Z .................................................................................................... 6200/9198
2019-10-19T07:46:41.0209742Z .................................................................................................... 6200/9198
2019-10-19T07:46:57.7030744Z .......i..ii........................................................................................ 6300/9198
2019-10-19T07:47:18.6130875Z ...................................................................i................................ 6500/9198
2019-10-19T07:47:20.9596619Z .................................................................................................... 6600/9198
2019-10-19T07:47:23.6118289Z ..........................................i......................................................... 6700/9198
2019-10-19T07:47:27.7315729Z .................................................................................................... 6800/9198
---
2019-10-19T07:51:48.8238870Z normalized stderr:
2019-10-19T07:51:48.8239081Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8239484Z   --> $DIR/alignment-gep-tup-like-1.rs:31:10
2019-10-19T07:51:48.8240020Z    |
2019-10-19T07:51:48.8240735Z LL |     } as (Box<dyn Invokable<A>+'static>)
2019-10-19T07:51:48.8241052Z    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8241398Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8241535Z 
2019-10-19T07:51:48.8241666Z 
2019-10-19T07:51:48.8241817Z 
2019-10-19T07:51:48.8241817Z 
2019-10-19T07:51:48.8241948Z 
2019-10-19T07:51:48.8242104Z The actual stderr differed from the expected stderr.
2019-10-19T07:51:48.8242603Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/alignment-gep-tup-like-1/alignment-gep-tup-like-1.stderr
2019-10-19T07:51:48.8243065Z To update references, rerun the tests and pass the `--bless` flag
2019-10-19T07:51:48.8243536Z To only update this specific test, also pass `--test-args alignment-gep-tup-like-1.rs`
2019-10-19T07:51:48.8243897Z error: 1 errors occurred comparing output.
2019-10-19T07:51:48.8244051Z status: exit code: 0
2019-10-19T07:51:48.8244051Z status: exit code: 0
2019-10-19T07:51:48.8245041Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/alignment-gep-tup-like-1.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/alignment-gep-tup-like-1/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/alignment-gep-tup-like-1/auxiliary"
2019-10-19T07:51:48.8246462Z ------------------------------------------
2019-10-19T07:51:48.8246907Z 
2019-10-19T07:51:48.8247450Z ------------------------------------------
2019-10-19T07:51:48.8247683Z stderr:
2019-10-19T07:51:48.8247683Z stderr:
2019-10-19T07:51:48.8248072Z ------------------------------------------
2019-10-19T07:51:48.8248317Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8248725Z   --> /checkout/src/test/ui/alignment-gep-tup-like-1.rs:31:10
2019-10-19T07:51:48.8249093Z    |
2019-10-19T07:51:48.8249950Z LL |     } as (Box<dyn Invokable<A>+'static>)
2019-10-19T07:51:48.8250177Z    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8250506Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8250638Z 
2019-10-19T07:51:48.8250767Z 
2019-10-19T07:51:48.8251181Z ------------------------------------------
2019-10-19T07:51:48.8251181Z ------------------------------------------
2019-10-19T07:51:48.8251380Z 
2019-10-19T07:51:48.8251520Z 
2019-10-19T07:51:48.8251880Z ---- [ui] ui/as-precedence.rs stdout ----
2019-10-19T07:51:48.8252075Z normalized stderr:
2019-10-19T07:51:48.8252282Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8252879Z   --> $DIR/as-precedence.rs:5:21
2019-10-19T07:51:48.8253102Z    |
2019-10-19T07:51:48.8253259Z LL |     assert_eq!(3 as (usize) * 3, 9);
2019-10-19T07:51:48.8253413Z    |                     ^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8253736Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8253871Z 
2019-10-19T07:51:48.8254043Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8254404Z   --> $DIR/as-precedence.rs:6:21
2019-10-19T07:51:48.8254404Z   --> $DIR/as-precedence.rs:6:21
2019-10-19T07:51:48.8254612Z    |
2019-10-19T07:51:48.8254763Z LL |     assert_eq!(3 as (usize) / 3, 1);
2019-10-19T07:51:48.8255418Z    |                     ^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8255746Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8256204Z   --> $DIR/as-precedence.rs:8:21
2019-10-19T07:51:48.8256415Z    |
2019-10-19T07:51:48.8256415Z    |
2019-10-19T07:51:48.8256616Z LL |     assert_eq!(3 as (usize) + 3, 6);
2019-10-19T07:51:48.8256783Z    |                     ^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8257124Z 
2019-10-19T07:51:48.8257299Z 
2019-10-19T07:51:48.8257454Z 
2019-10-19T07:51:48.8257617Z The actual stderr differed from the expected stderr.
2019-10-19T07:51:48.8257617Z The actual stderr differed from the expected stderr.
2019-10-19T07:51:48.8258098Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/as-precedence/as-precedence.stderr
2019-10-19T07:51:48.8258568Z To update references, rerun the tests and pass the `--bless` flag
2019-10-19T07:51:48.8259164Z To only update this specific test, also pass `--test-args as-precedence.rs`
2019-10-19T07:51:48.8259544Z error: 1 errors occurred comparing output.
2019-10-19T07:51:48.8259693Z status: exit code: 0
2019-10-19T07:51:48.8259693Z status: exit code: 0
2019-10-19T07:51:48.8260497Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/as-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/as-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/as-precedence/auxiliary"
2019-10-19T07:51:48.8261148Z ------------------------------------------
2019-10-19T07:51:48.8261327Z 
2019-10-19T07:51:48.8261678Z ------------------------------------------
2019-10-19T07:51:48.8262084Z stderr:
2019-10-19T07:51:48.8262084Z stderr:
2019-10-19T07:51:48.8262643Z ------------------------------------------
2019-10-19T07:51:48.8262854Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8263247Z   --> /checkout/src/test/ui/as-precedence.rs:5:21
2019-10-19T07:51:48.8263451Z    |
2019-10-19T07:51:48.8263792Z LL |     assert_eq!(3 as (usize) * 3, 9);
2019-10-19T07:51:48.8263954Z    |                     ^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8264643Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8265299Z 
2019-10-19T07:51:48.8265501Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8266225Z   --> /checkout/src/test/ui/as-precedence.rs:6:21
2019-10-19T07:51:48.8266225Z   --> /checkout/src/test/ui/as-precedence.rs:6:21
2019-10-19T07:51:48.8269281Z    |
2019-10-19T07:51:48.8269561Z LL |     assert_eq!(3 as (usize) / 3, 1);
2019-10-19T07:51:48.8269723Z    |                     ^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8270194Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8271372Z   --> /checkout/src/test/ui/as-precedence.rs:8:21
2019-10-19T07:51:48.8271601Z    |
2019-10-19T07:51:48.8271601Z    |
2019-10-19T07:51:48.8271921Z LL |     assert_eq!(3 as (usize) + 3, 6);
2019-10-19T07:51:48.8272094Z    |                     ^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8272393Z 
2019-10-19T07:51:48.8272803Z ------------------------------------------
2019-10-19T07:51:48.8273008Z 
2019-10-19T07:51:48.8273160Z 
2019-10-19T07:51:48.8273160Z 
2019-10-19T07:51:48.8273576Z ---- [ui] ui/close-over-big-then-small-data.rs stdout ----
2019-10-19T07:51:48.8274213Z normalized stderr:
2019-10-19T07:51:48.8274400Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8274824Z   --> $DIR/close-over-big-then-small-data.rs:33:10
2019-10-19T07:51:48.8275028Z    |
2019-10-19T07:51:48.8276064Z LL |     } as (Box<dyn Invokable<A>+'static>)
2019-10-19T07:51:48.8276325Z    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8276665Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8276823Z 
2019-10-19T07:51:48.8276961Z 
2019-10-19T07:51:48.8277101Z 
2019-10-19T07:51:48.8277101Z 
2019-10-19T07:51:48.8277239Z 
2019-10-19T07:51:48.8277420Z The actual stderr differed from the expected stderr.
2019-10-19T07:51:48.8277932Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/close-over-big-then-small-data/close-over-big-then-small-data.stderr
2019-10-19T07:51:48.8278438Z To update references, rerun the tests and pass the `--bless` flag
2019-10-19T07:51:48.8279174Z To only update this specific test, also pass `--test-args close-over-big-then-small-data.rs`
2019-10-19T07:51:48.8279549Z error: 1 errors occurred comparing output.
2019-10-19T07:51:48.8279706Z status: exit code: 0
2019-10-19T07:51:48.8279706Z status: exit code: 0
2019-10-19T07:51:48.8280596Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/close-over-big-then-small-data.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/close-over-big-then-small-data/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/close-over-big-then-small-data/auxiliary"
2019-10-19T07:51:48.8281272Z ------------------------------------------
2019-10-19T07:51:48.8281461Z 
2019-10-19T07:51:48.8281835Z ------------------------------------------
2019-10-19T07:51:48.8282029Z stderr:
2019-10-19T07:51:48.8282029Z stderr:
2019-10-19T07:51:48.8282421Z ------------------------------------------
2019-10-19T07:51:48.8282647Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8283047Z   --> /checkout/src/test/ui/close-over-big-then-small-data.rs:33:10
2019-10-19T07:51:48.8283245Z    |
2019-10-19T07:51:48.8291052Z LL |     } as (Box<dyn Invokable<A>+'static>)
2019-10-19T07:51:48.8292758Z    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8293160Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8293446Z 
2019-10-19T07:51:48.8293762Z 
2019-10-19T07:51:48.8294372Z ------------------------------------------
2019-10-19T07:51:48.8294372Z ------------------------------------------
2019-10-19T07:51:48.8294551Z 
2019-10-19T07:51:48.8294694Z 
2019-10-19T07:51:48.8295809Z ---- [ui] ui/functions-closures/closure-to-fn-coercion.rs stdout ----
2019-10-19T07:51:48.8296072Z normalized stderr:
2019-10-19T07:51:48.8296256Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8296698Z   --> $DIR/closure-to-fn-coercion.rs:13:23
2019-10-19T07:51:48.8296895Z    |
2019-10-19T07:51:48.8297268Z LL | fn func_specific() -> (fn() -> u32) {
2019-10-19T07:51:48.8297487Z    |                       ^^^^^^^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8297818Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8297959Z 
2019-10-19T07:51:48.8298091Z 
2019-10-19T07:51:48.8298224Z 
2019-10-19T07:51:48.8298224Z 
2019-10-19T07:51:48.8298355Z 
2019-10-19T07:51:48.8298532Z The actual stderr differed from the expected stderr.
2019-10-19T07:51:48.8299168Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/functions-closures/closure-to-fn-coercion/closure-to-fn-coercion.stderr
2019-10-19T07:51:48.8300361Z To update references, rerun the tests and pass the `--bless` flag
2019-10-19T07:51:48.8301716Z To only update this specific test, also pass `--test-args functions-closures/closure-to-fn-coercion.rs`
2019-10-19T07:51:48.8301990Z error: 1 errors occurred comparing output.
2019-10-19T07:51:48.8302037Z status: exit code: 0
2019-10-19T07:51:48.8302037Z status: exit code: 0
2019-10-19T07:51:48.8302855Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/functions-closures/closure-to-fn-coercion.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/functions-closures/closure-to-fn-coercion/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/functions-closures/closure-to-fn-coercion/auxiliary"
2019-10-19T07:51:48.8303219Z ------------------------------------------
2019-10-19T07:51:48.8303256Z 
2019-10-19T07:51:48.8303496Z ------------------------------------------
2019-10-19T07:51:48.8303553Z stderr:
2019-10-19T07:51:48.8303553Z stderr:
2019-10-19T07:51:48.8304278Z ------------------------------------------
2019-10-19T07:51:48.8304341Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8305496Z   --> /checkout/src/test/ui/functions-closures/closure-to-fn-coercion.rs:13:23
2019-10-19T07:51:48.8305584Z    |
2019-10-19T07:51:48.8305865Z LL | fn func_specific() -> (fn() -> u32) {
2019-10-19T07:51:48.8305921Z    |                       ^^^^^^^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8306033Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8306066Z 
2019-10-19T07:51:48.8306092Z 
2019-10-19T07:51:48.8306332Z ------------------------------------------
2019-10-19T07:51:48.8306332Z ------------------------------------------
2019-10-19T07:51:48.8306365Z 
2019-10-19T07:51:48.8306391Z 
2019-10-19T07:51:48.8306628Z ---- [ui] ui/single-use-lifetime/zero-uses-in-fn.rs stdout ----
2019-10-19T07:51:48.8306677Z 
2019-10-19T07:51:48.8306743Z error: fixed code is still producing diagnostics
2019-10-19T07:51:48.8306797Z status: exit code: 0
2019-10-19T07:51:48.8307549Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.fixed" "-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/single-use-lifetime/zero-uses-in-fn/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/single-use-lifetime/zero-uses-in-fn/auxiliary"
2019-10-19T07:51:48.8307887Z ------------------------------------------
2019-10-19T07:51:48.8307941Z 
2019-10-19T07:51:48.8308164Z ------------------------------------------
2019-10-19T07:51:48.8308211Z stderr:
2019-10-19T07:51:48.8308211Z stderr:
2019-10-19T07:51:48.8308759Z ------------------------------------------
2019-10-19T07:51:48.8308828Z warning: unnecessary parentheses around type
2019-10-19T07:51:48.8309104Z   --> /checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.fixed:18:32
2019-10-19T07:51:48.8309172Z    |
2019-10-19T07:51:48.8309384Z LL | fn november<'a>(s: &'a str) -> (&'a str) {
2019-10-19T07:51:48.8309436Z    |                                ^^^^^^^^^ help: remove these parentheses
2019-10-19T07:51:48.8309538Z    = note: `#[warn(unused_parens)]` on by default
2019-10-19T07:51:48.8309567Z 
2019-10-19T07:51:48.8309591Z 
2019-10-19T07:51:48.8310870Z ------------------------------------------
---
2019-10-19T07:51:48.8313312Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-10-19T07:51:48.8313370Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-10-19T07:51:48.8313556Z 
2019-10-19T07:51:48.8313597Z 
2019-10-19T07:51:48.8315348Z 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-10-19T07:51:48.8315633Z 
2019-10-19T07:51:48.8315664Z 
2019-10-19T07:51:48.8321080Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-10-19T07:51:48.8321191Z Build completed unsuccessfully in 1:11:38
2019-10-19T07:51:48.8321191Z Build completed unsuccessfully in 1:11:38
2019-10-19T07:51:48.8372931Z == clock drift check ==
2019-10-19T07:51:48.8392291Z   local time: Sat Oct 19 07:51:48 UTC 2019
2019-10-19T07:51:49.1300268Z   network time: Sat, 19 Oct 2019 07:51:49 GMT
2019-10-19T07:51:49.1303017Z == end clock drift check ==
2019-10-19T07:51:50.3195806Z 
2019-10-19T07:51:50.3308592Z ##[error]Bash exited with code '1'.
2019-10-19T07:51:50.3349755Z ##[section]Starting: Checkout
2019-10-19T07:51:50.3352423Z ==============================================================================
2019-10-19T07:51:50.3352478Z Task         : Get sources
2019-10-19T07:51:50.3352524Z 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 (pretty log, 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-10-20T19:10:55.3671330Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-20T19:10:55.3897497Z ##[command]git config gc.auto 0
2019-10-20T19:10:55.3979086Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-20T19:10:55.4035267Z ##[command]git config --get-all http.proxy
2019-10-20T19:10:55.4208179Z ##[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/65112/merge:refs/remotes/pull/65112/merge
---
2019-10-20T20:16:32.5289877Z .................................................................................................... 1600/9203
2019-10-20T20:16:38.2069027Z .................................................................................................... 1700/9203
2019-10-20T20:16:51.9348008Z ................................i...............i................................................... 1800/9203
2019-10-20T20:16:59.7967996Z .................................................................................................... 1900/9203
2019-10-20T20:17:14.6893791Z ......................iiiii......................................................................... 2000/9203
2019-10-20T20:17:25.7306986Z .................................................................................................... 2200/9203
2019-10-20T20:17:28.4653305Z .................................................................................................... 2300/9203
2019-10-20T20:17:33.8142291Z .................................................................................................... 2400/9203
2019-10-20T20:17:57.4783840Z .................................................................................................... 2500/9203
---
2019-10-20T20:21:01.1980998Z .........................i...............i.......................................................... 4800/9203
2019-10-20T20:21:13.7542786Z .................................................................................................... 4900/9203
2019-10-20T20:21:20.2892997Z .................................................................................................... 5000/9203
2019-10-20T20:21:29.9470442Z .................................................................................................... 5100/9203
2019-10-20T20:21:37.7471665Z .........................ii.ii...................................................................... 5200/9203
2019-10-20T20:21:48.2607725Z .................................................................................................... 5400/9203
2019-10-20T20:21:59.1547752Z ...........................................................................................i........ 5500/9203
2019-10-20T20:22:07.7161902Z .................................................................................................... 5600/9203
2019-10-20T20:22:12.7810188Z .................................................................................................... 5700/9203
2019-10-20T20:22:12.7810188Z .................................................................................................... 5700/9203
2019-10-20T20:22:24.0179592Z ........................................................................................ii...i..ii.. 5800/9203
2019-10-20T20:22:52.0067060Z .................................................................................................... 6000/9203
2019-10-20T20:23:01.9731715Z .................................................................................................... 6100/9203
2019-10-20T20:23:07.9464094Z .................................................................................................... 6200/9203
2019-10-20T20:23:07.9464094Z .................................................................................................... 6200/9203
2019-10-20T20:23:22.4495322Z ..........i..ii..................................................................................... 6300/9203
2019-10-20T20:23:43.2814212Z ......................................................................i............................. 6500/9203
2019-10-20T20:23:45.6092138Z .................................................................................................... 6600/9203
2019-10-20T20:23:48.1471781Z .............................................i...................................................... 6700/9203
2019-10-20T20:23:51.9519058Z .................................................................................................... 6800/9203
---
2019-10-20T20:28:08.5469738Z 
2019-10-20T20:28:08.5470004Z 21 error: lifetime parameter `'b` never used
2019-10-20T20:28:08.5470242Z 22   --> $DIR/zero-uses-in-fn.rs:18:17
2019-10-20T20:28:08.5470311Z 23    |
2019-10-20T20:28:08.5470555Z - LL | fn november<'a, 'b>(s: &'a str) -> (&'a str) {
2019-10-20T20:28:08.5470799Z + LL | fn november<'a, 'b>(s: &'a str) -> &'a str {
2019-10-20T20:28:08.5471041Z 25    |               --^^
2019-10-20T20:28:08.5471139Z 27    |               help: elide the unused lifetime
2019-10-20T20:28:08.5471170Z 
2019-10-20T20:28:08.5471458Z 
2019-10-20T20:28:08.5471609Z The actual stderr differed from the expected stderr.
2019-10-20T20:28:08.5471609Z The actual stderr differed from the expected stderr.
2019-10-20T20:28:08.5471993Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/single-use-lifetime/zero-uses-in-fn/zero-uses-in-fn.stderr
2019-10-20T20:28:08.5472075Z diff of fixed:
2019-10-20T20:28:08.5472107Z 
2019-10-20T20:28:08.5472147Z 15     s
2019-10-20T20:28:08.5472187Z 16 }
2019-10-20T20:28:08.5472247Z 17 
2019-10-20T20:28:08.5472487Z - fn november<'a>(s: &'a str) -> (&'a str) {
2019-10-20T20:28:08.5472723Z + fn november<'a>(s: &'a str) -> &'a str {
2019-10-20T20:28:08.5472988Z 19     //~^ ERROR lifetime parameter `'b` never used
2019-10-20T20:28:08.5473203Z 20     //~| HELP elide the unused lifetime
2019-10-20T20:28:08.5473270Z 
2019-10-20T20:28:08.5473313Z 
2019-10-20T20:28:08.5473356Z The actual fixed differed from the expected fixed.
2019-10-20T20:28:08.5473356Z The actual fixed differed from the expected fixed.
2019-10-20T20:28:08.5473680Z Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/single-use-lifetime/zero-uses-in-fn/zero-uses-in-fn.fixed
2019-10-20T20:28:08.5473965Z To update references, rerun the tests and pass the `--bless` flag
2019-10-20T20:28:08.5474277Z To only update this specific test, also pass `--test-args single-use-lifetime/zero-uses-in-fn.rs`
2019-10-20T20:28:08.5474364Z error: 2 errors occurred comparing output.
2019-10-20T20:28:08.5474429Z status: exit code: 1
2019-10-20T20:28:08.5474429Z status: exit code: 1
2019-10-20T20:28:08.5475213Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.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/single-use-lifetime/zero-uses-in-fn" "-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/single-use-lifetime/zero-uses-in-fn/auxiliary" "-A" "unused"
2019-10-20T20:28:08.5475583Z ------------------------------------------
2019-10-20T20:28:08.5475618Z 
2019-10-20T20:28:08.5476051Z ------------------------------------------
2019-10-20T20:28:08.5476100Z stderr:
2019-10-20T20:28:08.5476100Z stderr:
2019-10-20T20:28:08.5476327Z ------------------------------------------
2019-10-20T20:28:08.5476574Z error: lifetime parameter `'a` never used
2019-10-20T20:28:08.5476841Z   --> /checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.rs:8:14
2019-10-20T20:28:08.5476895Z    |
2019-10-20T20:28:08.5477128Z LL | fn september<'a>() {}
2019-10-20T20:28:08.5477662Z    |             -^^- help: elide the unused lifetime
2019-10-20T20:28:08.5477762Z note: lint level defined here
2019-10-20T20:28:08.5478047Z   --> /checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.rs:5:9
2019-10-20T20:28:08.5478098Z    |
2019-10-20T20:28:08.5478140Z LL | #![deny(unused_lifetimes)]
2019-10-20T20:28:08.5478140Z LL | #![deny(unused_lifetimes)]
2019-10-20T20:28:08.5478204Z    |         ^^^^^^^^^^^^^^^^
2019-10-20T20:28:08.5478253Z 
2019-10-20T20:28:08.5478487Z error: lifetime parameter `'a` never used
2019-10-20T20:28:08.5478751Z   --> /checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.rs:12:12
2019-10-20T20:28:08.5478821Z    |
2019-10-20T20:28:08.5479056Z LL | fn october<'a, 'b, T>(s: &'b T) -> &'b T {
2019-10-20T20:28:08.5479268Z    |            ^^--
2019-10-20T20:28:08.5479381Z    |            help: elide the unused lifetime
2019-10-20T20:28:08.5479412Z 
2019-10-20T20:28:08.5479641Z error: lifetime parameter `'b` never used
2019-10-20T20:28:08.5479925Z   --> /checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.rs:18:17
2019-10-20T20:28:08.5479925Z   --> /checkout/src/test/ui/single-use-lifetime/zero-uses-in-fn.rs:18:17
2019-10-20T20:28:08.5479974Z    |
2019-10-20T20:28:08.5480209Z LL | fn november<'a, 'b>(s: &'a str) -> &'a str {
2019-10-20T20:28:08.5480445Z    |               --^^
2019-10-20T20:28:08.5480539Z    |               help: elide the unused lifetime
2019-10-20T20:28:08.5480882Z 
2019-10-20T20:28:08.5481014Z error: aborting due to 3 previous errors
2019-10-20T20:28:08.5481048Z 
---
2019-10-20T20:28:08.5512048Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-10-20T20:28:08.5512139Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-10-20T20:28:08.5536472Z 
2019-10-20T20:28:08.5536600Z 
2019-10-20T20:28:08.5539037Z 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-10-20T20:28:08.5539383Z 
2019-10-20T20:28:08.5539416Z 
2019-10-20T20:28:08.5550265Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-10-20T20:28:08.5550363Z Build completed unsuccessfully in 1:10:02
2019-10-20T20:28:08.5550363Z Build completed unsuccessfully in 1:10:02
2019-10-20T20:28:08.5602954Z == clock drift check ==
2019-10-20T20:28:08.5618053Z   local time: Sun Oct 20 20:28:08 UTC 2019
2019-10-20T20:28:08.7124316Z   network time: Sun, 20 Oct 2019 20:28:08 GMT
2019-10-20T20:28:08.7124629Z == end clock drift check ==
2019-10-20T20:28:09.9774767Z 
2019-10-20T20:28:09.9881942Z ##[error]Bash exited with code '1'.
2019-10-20T20:28:09.9926414Z ##[section]Starting: Checkout
2019-10-20T20:28:09.9928905Z ==============================================================================
2019-10-20T20:28:09.9929000Z Task         : Get sources
2019-10-20T20:28:09.9929047Z 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)

@Centril
Copy link
Contributor

Centril commented Oct 25, 2019

r? @varkor

@rust-highfive rust-highfive assigned varkor and unassigned zackmdavis Oct 25, 2019
Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good! Just a few stylistic comments, and then it's good to go! Also, if you could squash the tidy commit into one of the others, that would help keep the commit history cleaner.

src/test/ui/as-precedence.rs Show resolved Hide resolved
fn check_ty(&mut self, cx: &EarlyContext<'_>, ty: &ast::Ty) {
if let &ast::TyKind::Paren(ref r) = &ty.kind {
match &r.kind {
&ast::TyKind::TraitObject(..) => {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&ast::TyKind::TraitObject(..) => {},
&ast::TyKind::TraitObject(..) => {}

if let &ast::TyKind::Paren(ref r) = &ty.kind {
match &r.kind {
&ast::TyKind::TraitObject(..) => {},
&ast::TyKind::ImplTrait(_, ref bounds) if bounds.len() > 1 => {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&ast::TyKind::ImplTrait(_, ref bounds) if bounds.len() > 1 => {},
&ast::TyKind::ImplTrait(_, ref bounds) if bounds.len() > 1 => {}

};

Self::remove_outer_parens(cx, ty.span, &pattern_text, "type", (false, false));
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
},
}

@jack-t
Copy link
Contributor Author

jack-t commented Oct 29, 2019

Thanks, @varkor! The last commit in this PR is a squashed version of the previous commits, plus changes to address the changes you suggested above.

Let me know if there's anything else I need to do!

Jack

@varkor
Copy link
Member

varkor commented Oct 29, 2019

Thanks @jack-t, this looks great!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 29, 2019

📌 Commit 08ca236 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 Oct 29, 2019
tmandry added a commit to tmandry/rust that referenced this pull request Oct 30, 2019
Add lint and tests for unnecessary parens around types

This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.

The PR fixes rust-lang#64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` &mdash; I'm not totally sure it worked right, though &mdash; and I've tried to follow the instructions linked in the readme.

I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.

There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
Centril added a commit to Centril/rust that referenced this pull request Oct 30, 2019
Add lint and tests for unnecessary parens around types

This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.

The PR fixes rust-lang#64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` &mdash; I'm not totally sure it worked right, though &mdash; and I've tried to follow the instructions linked in the readme.

I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.

There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
tmandry added a commit to tmandry/rust that referenced this pull request Oct 31, 2019
Add lint and tests for unnecessary parens around types

This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.

The PR fixes rust-lang#64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` &mdash; I'm not totally sure it worked right, though &mdash; and I've tried to follow the instructions linked in the readme.

I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.

There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
bors added a commit that referenced this pull request Oct 31, 2019
Rollup of 14 pull requests

Successful merges:

 - #65112 (Add lint and tests for unnecessary parens around types)
 - #65459 (Fix `-Zunpretty=mir-cfg` to render multiple items)
 - #65471 (Add long error explanation for E0578)
 - #65857 (rustdoc: Resolve module-level doc references more locally)
 - #65914 (Use structured suggestion for unnecessary bounds in type aliases)
 - #65945 (Optimize long-linker-command-line test)
 - #65946 (Make `promote_consts` emit the errors when required promotion fails)
 - #65960 (doc: reword iter module example and mention other methods)
 - #65963 (update submodules to rust-lang)
 - #65972 (Fix libunwind build: Define __LITTLE_ENDIAN__ for LE targets)
 - #65977 (Fix incorrect diagnostics for expected type in E0271 with an associated type)
 - #65995 (Add error code E0743 for "C-variadic has been used on a non-foreign function")
 - #65997 (Fix outdated rustdoc of Once::init_locking function)
 - #66005 (vxWorks: remove code related unix socket)

Failed merges:

r? @ghost
tmandry added a commit to tmandry/rust that referenced this pull request Nov 1, 2019
Add lint and tests for unnecessary parens around types

This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.

The PR fixes rust-lang#64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` &mdash; I'm not totally sure it worked right, though &mdash; and I've tried to follow the instructions linked in the readme.

I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.

There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
bors added a commit that referenced this pull request Nov 1, 2019
Rollup of 16 pull requests

Successful merges:

 - #65112 (Add lint and tests for unnecessary parens around types)
 - #65470 (Don't hide ICEs from previous incremental compiles)
 - #65471 (Add long error explanation for E0578)
 - #65857 (rustdoc: Resolve module-level doc references more locally)
 - #65902 (Make ItemContext available for better diagnositcs)
 - #65914 (Use structured suggestion for unnecessary bounds in type aliases)
 - #65946 (Make `promote_consts` emit the errors when required promotion fails)
 - #65960 (doc: reword iter module example and mention other methods)
 - #65963 (update submodules to rust-lang)
 - #65972 (Fix libunwind build: Define __LITTLE_ENDIAN__ for LE targets)
 - #65977 (Fix incorrect diagnostics for expected type in E0271 with an associated type)
 - #65995 (Add error code E0743 for "C-variadic has been used on a non-foreign function")
 - #65997 (Fix outdated rustdoc of Once::init_locking function)
 - #66002 (Stabilize float_to_from_bytes feature)
 - #66005 (vxWorks: remove code related unix socket)
 - #66018 (Revert PR 64324: dylibs export generics again (for now))

Failed merges:

r? @ghost
@bors bors merged commit 08ca236 into rust-lang:master Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No unnecessary parentheses warning in types
7 participants