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

Implement unused_parens for const and static items #68751

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

Tyg13
Copy link
Contributor

@Tyg13 Tyg13 commented Feb 1, 2020

Fixes #67942

@rust-highfive
Copy link
Collaborator

r? @cramertj

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

@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • These commits modify submodules.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 1, 2020
@Tyg13 Tyg13 changed the title unused-parens: implement for const/static items Implement unused_parens for const and static items Feb 1, 2020
@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
2020-02-01T23:06:41.6634304Z ========================== Starting Command Output ===========================
2020-02-01T23:06:41.6637082Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/26880c7c-43f6-4d1b-9f93-b6524a059dd9.sh
2020-02-01T23:06:41.6637287Z 
2020-02-01T23:06:41.6882050Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-01T23:06:41.6888017Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-01T23:06:41.6890315Z Task         : Get sources
2020-02-01T23:06:41.6890349Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T23:06:41.6890381Z Version      : 1.0.0
2020-02-01T23:06:41.6890428Z Author       : Microsoft
---
2020-02-01T23:06:42.6594411Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-01T23:06:42.6605266Z ##[command]git config gc.auto 0
2020-02-01T23:06:42.6608108Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-01T23:06:42.6610707Z ##[command]git config --get-all http.proxy
2020-02-01T23:06:42.6679496Z ##[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/68751/merge:refs/remotes/pull/68751/merge
---
2020-02-01T23:12:11.0039907Z   local time: Sat Feb  1 23:12:11 UTC 2020
2020-02-01T23:12:11.5455454Z   network time: Sat, 01 Feb 2020 23:12:11 GMT
2020-02-01T23:12:11.5459506Z == end clock drift check ==
2020-02-01T23:12:12.4935974Z 
2020-02-01T23:12:12.5020775Z ##[error]Bash exited with code '1'.
2020-02-01T23:12:12.5035904Z ##[section]Finishing: Run build
2020-02-01T23:12:12.5053275Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-01T23:12:12.5055395Z Task         : Get sources
2020-02-01T23:12:12.5055446Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T23:12:12.5055516Z Version      : 1.0.0
2020-02-01T23:12:12.5055563Z Author       : Microsoft
2020-02-01T23:12:12.5055563Z Author       : Microsoft
2020-02-01T23:12:12.5055613Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-01T23:12:12.5055685Z ==============================================================================
2020-02-01T23:12:12.9542101Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-01T23:12:12.9588633Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-01T23:12:12.9713078Z Cleaning up task key
2020-02-01T23:12:12.9713948Z Start cleaning up orphan processes.
2020-02-01T23:12:12.9839614Z Terminate orphan process: pid (6326) (python)
2020-02-01T23:12:13.0048450Z ##[section]Finishing: Finalize Job

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)

@Tyg13
Copy link
Contributor Author

Tyg13 commented Feb 1, 2020

Ah, darn. Looks like there are some issues to be resolved with the submodule. I'll update it in a separate branch and resolve them there.

@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
2020-02-01T23:34:17.0799386Z ========================== Starting Command Output ===========================
2020-02-01T23:34:17.0801645Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/98d5b51a-cdc6-4a30-b9a1-c7d8e3a7f3f8.sh
2020-02-01T23:34:17.0801726Z 
2020-02-01T23:34:17.0805112Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-01T23:34:17.0811898Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-01T23:34:17.0813274Z Task         : Get sources
2020-02-01T23:34:17.0813302Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T23:34:17.0813329Z Version      : 1.0.0
2020-02-01T23:34:17.0813392Z Author       : Microsoft
---
2020-02-01T23:34:18.0589638Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-01T23:34:18.0601590Z ##[command]git config gc.auto 0
2020-02-01T23:34:18.0603420Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-01T23:34:18.0604928Z ##[command]git config --get-all http.proxy
2020-02-01T23:34:18.0612169Z ##[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/68751/merge:refs/remotes/pull/68751/merge
---
2020-02-01T23:38:47.2069079Z   local time: Sat Feb  1 23:38:47 UTC 2020
2020-02-01T23:38:47.4960791Z   network time: Sat, 01 Feb 2020 23:38:47 GMT
2020-02-01T23:38:47.4964194Z == end clock drift check ==
2020-02-01T23:38:48.5030170Z 
2020-02-01T23:38:48.5164682Z ##[error]Bash exited with code '1'.
2020-02-01T23:38:48.5179032Z ##[section]Finishing: Run build
2020-02-01T23:38:48.5200144Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-01T23:38:48.5203256Z Task         : Get sources
2020-02-01T23:38:48.5203305Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T23:38:48.5203369Z Version      : 1.0.0
2020-02-01T23:38:48.5203432Z Author       : Microsoft
2020-02-01T23:38:48.5203432Z Author       : Microsoft
2020-02-01T23:38:48.5203479Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-01T23:38:48.5203548Z ==============================================================================
2020-02-01T23:38:48.9684880Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-01T23:38:48.9720191Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-01T23:38:48.9853427Z Cleaning up task key
2020-02-01T23:38:48.9854264Z Start cleaning up orphan processes.
2020-02-01T23:38:48.9975568Z Terminate orphan process: pid (3739) (python)
2020-02-01T23:38:49.0178658Z ##[section]Finishing: Finalize Job

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)

src/librustc_lint/unused.rs Outdated Show resolved Hide resolved
@Centril
Copy link
Contributor

Centril commented Feb 2, 2020

r? @Centril r=me once the submodule PR (#68755) has landed and with the if let change.

@rust-highfive rust-highfive assigned Centril and unassigned cramertj Feb 2, 2020
@Centril Centril 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 Feb 2, 2020
@Tyg13
Copy link
Contributor Author

Tyg13 commented Feb 6, 2020

@bors r=Centril

@bors
Copy link
Contributor

bors commented Feb 6, 2020

@Tyg13: 🔑 Insufficient privileges: Not in reviewers

@Centril
Copy link
Contributor

Centril commented Feb 6, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Feb 6, 2020

📌 Commit 27643862db942b077c5fe731ffdc31e9f0ede161 has been approved by Centril

@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 Feb 6, 2020
@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
2020-02-06T01:37:00.6053131Z ========================== Starting Command Output ===========================
2020-02-06T01:37:00.6055500Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/401bcf38-52fc-4ae7-a7b8-384883083d2c.sh
2020-02-06T01:37:00.6055696Z 
2020-02-06T01:37:00.6093004Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-06T01:37:00.6099163Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-06T01:37:00.6100717Z Task         : Get sources
2020-02-06T01:37:00.6100751Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-06T01:37:00.6100825Z Version      : 1.0.0
2020-02-06T01:37:00.6100857Z Author       : Microsoft
---
2020-02-06T01:37:01.4078679Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-06T01:37:01.4170218Z ##[command]git config gc.auto 0
2020-02-06T01:37:01.4244313Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-06T01:37:01.4295486Z ##[command]git config --get-all http.proxy
2020-02-06T01:37:01.4427608Z ##[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/68751/merge:refs/remotes/pull/68751/merge
---
2020-02-06T01:44:15.6307514Z     Checking rustc_lint v0.0.0 (/checkout/src/librustc_lint)
2020-02-06T01:44:16.8025820Z error[E0308]: mismatched types
2020-02-06T01:44:16.8026167Z    --> src/librustc_lint/unused.rs:594:16
2020-02-06T01:44:16.8026400Z     |
2020-02-06T01:44:16.8027072Z 594 |         if let &Const(.., ref expr) | &Static(.., ref expr) = item.kind {
2020-02-06T01:44:16.8027712Z     |
2020-02-06T01:44:16.8028289Z     = note:   expected enum `syntax::ast::ItemKind`
2020-02-06T01:44:16.8028564Z             found reference `&_`
2020-02-06T01:44:16.8028603Z 
2020-02-06T01:44:16.8028603Z 
2020-02-06T01:44:16.8056901Z error[E0308]: mismatched types
2020-02-06T01:44:16.8057208Z    --> src/librustc_lint/unused.rs:594:39
2020-02-06T01:44:16.8057466Z     |
2020-02-06T01:44:16.8058001Z 594 |         if let &Const(.., ref expr) | &Static(.., ref expr) = item.kind {
2020-02-06T01:44:16.8058657Z     |
2020-02-06T01:44:16.8058971Z     = note:   expected enum `syntax::ast::ItemKind`
2020-02-06T01:44:16.8059239Z             found reference `&_`
2020-02-06T01:44:16.8059277Z 
2020-02-06T01:44:16.8059277Z 
2020-02-06T01:44:16.8271819Z error: aborting due to 2 previous errors
2020-02-06T01:44:16.8271900Z 
2020-02-06T01:44:16.8278707Z For more information about this error, try `rustc --explain E0308`.
2020-02-06T01:44:16.8327022Z error: could not compile `rustc_lint`.
2020-02-06T01:44:16.8327372Z warning: build failed, waiting for other jobs to finish...
2020-02-06T01:44:22.6983158Z error: build failed
2020-02-06T01:44:22.7008699Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
2020-02-06T01:44:22.7020290Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2020-02-06T01:44:22.7020806Z Build completed unsuccessfully in 0:05:05
2020-02-06T01:44:22.7070360Z == clock drift check ==
2020-02-06T01:44:22.7078165Z   local time: Thu Feb  6 01:44:22 UTC 2020
2020-02-06T01:44:22.7078165Z   local time: Thu Feb  6 01:44:22 UTC 2020
2020-02-06T01:44:22.8637200Z   network time: Thu, 06 Feb 2020 01:44:22 GMT
2020-02-06T01:44:22.8638972Z == end clock drift check ==
2020-02-06T01:44:23.4453508Z 
2020-02-06T01:44:23.4543624Z ##[error]Bash exited with code '1'.
2020-02-06T01:44:23.4555282Z ##[section]Finishing: Run build
2020-02-06T01:44:23.4573254Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-06T01:44:23.4575156Z Task         : Get sources
2020-02-06T01:44:23.4575208Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-06T01:44:23.4575275Z Version      : 1.0.0
2020-02-06T01:44:23.4575321Z Author       : Microsoft
2020-02-06T01:44:23.4575321Z Author       : Microsoft
2020-02-06T01:44:23.4575371Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-06T01:44:23.4575439Z ==============================================================================
2020-02-06T01:44:23.8442253Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-06T01:44:23.8483084Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68751/merge to s
2020-02-06T01:44:23.8590397Z Cleaning up task key
2020-02-06T01:44:23.8591232Z Start cleaning up orphan processes.
2020-02-06T01:44:23.8847388Z Terminate orphan process: pid (4361) (python)
2020-02-06T01:44:23.8868708Z ##[section]Finishing: Finalize Job

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 Feb 6, 2020

@bors r-

@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 Feb 6, 2020
@Tyg13
Copy link
Contributor Author

Tyg13 commented Feb 6, 2020

Whoops, that's what I get for pushing without running check. Should be sorted now.

@Centril
Copy link
Contributor

Centril commented Feb 6, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Feb 6, 2020

📌 Commit d8cf950 has been approved by Centril

@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 Feb 6, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 6, 2020
…=Centril

Implement `unused_parens` for `const` and `static` items

Fixes rust-lang#67942
bors added a commit that referenced this pull request Feb 6, 2020
Rollup of 9 pull requests

Successful merges:

 - #68691 (Remove `RefCell` usage from `ObligationForest`.)
 - #68751 (Implement `unused_parens` for `const` and `static` items)
 - #68788 (Towards unified `fn` grammar)
 - #68837 (Make associated item collection a query)
 - #68842 (or_patterns: add regression test for #68785)
 - #68844 (use def_path_str for missing_debug_impls message)
 - #68845 (stop using BytePos for computing spans in librustc_parse/parser/mod.rs)
 - #68869 (clean up E0271 explanation)
 - #68880 (Forbid using `0` as issue number)

Failed merges:

r? @ghost
@bors bors merged commit d8cf950 into rust-lang:master Feb 6, 2020
@Tyg13 Tyg13 deleted the unused_parens_const_static branch February 6, 2020 19:03
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.

Missing unnecessary parentheses warning in constant expressions
5 participants