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 unused_braces lint #70081

Merged
merged 6 commits into from
Apr 1, 2020
Merged

add unused_braces lint #70081

merged 6 commits into from
Apr 1, 2020

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Mar 17, 2020

Add the lint unused_braces which is warn by default.

unused_parens is also extended and now checks anon consts.

closes #68387

r? @varkor

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 17, 2020
@lcnr
Copy link
Contributor Author

lcnr commented Mar 17, 2020

@eddyb, @varkor can I get some pointers on how to run this lint for const generic params?

@petrochenkov
Copy link
Contributor

The lint shouldn't be reported inside addressof expressions (&{expr} -> &expr), it changes the meaning of the code.

Constructions like these appear pretty often in expanded code if you have packed structs, e.g.

println!("{}", {packed_struct.field});

because you cannot bind references directly to their fields and many APIs take references.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-03-17T18:06:57.9984622Z ========================== Starting Command Output ===========================
2020-03-17T18:06:57.9987319Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/e665069c-3648-4b2f-b377-f5e97300721c.sh
2020-03-17T18:06:57.9987622Z 
2020-03-17T18:06:57.9992008Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-17T18:06:58.0013707Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-17T18:06:58.0016994Z Task         : Get sources
2020-03-17T18:06:58.0017427Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-17T18:06:58.0017745Z Version      : 1.0.0
2020-03-17T18:06:58.0017919Z Author       : Microsoft
---
2020-03-17T18:06:58.9910273Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-17T18:06:58.9915421Z ##[command]git config gc.auto 0
2020-03-17T18:06:58.9918983Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-17T18:06:58.9922261Z ##[command]git config --get-all http.proxy
2020-03-17T18:06:58.9928151Z ##[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/70081/merge:refs/remotes/pull/70081/merge
---
2020-03-17T18:43:10.0005753Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-03-17T18:43:14.2278155Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2283771Z   --> src/librustc/query/mod.rs:91:30
2020-03-17T18:43:14.2284393Z    |
2020-03-17T18:43:14.2285141Z 91 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2292257Z    |
2020-03-17T18:43:14.2293360Z    = note: `-D unused-parens` implied by `-D warnings`
2020-03-17T18:43:14.2293646Z 
2020-03-17T18:43:14.2294660Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2294660Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2295320Z    --> src/librustc/query/mod.rs:102:30
2020-03-17T18:43:14.2295776Z     |
2020-03-17T18:43:14.2296371Z 102 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2297981Z 
2020-03-17T18:43:14.2298444Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2299173Z    --> src/librustc/query/mod.rs:126:30
2020-03-17T18:43:14.2299818Z     |
2020-03-17T18:43:14.2299818Z     |
2020-03-17T18:43:14.2300957Z 126 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2302447Z 
2020-03-17T18:43:14.2309065Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2315874Z    --> src/librustc/query/mod.rs:163:30
2020-03-17T18:43:14.2316372Z     |
2020-03-17T18:43:14.2316372Z     |
2020-03-17T18:43:14.2316985Z 163 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2318536Z 
2020-03-17T18:43:14.2319065Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2319655Z    --> src/librustc/query/mod.rs:191:30
2020-03-17T18:43:14.2320486Z     |
2020-03-17T18:43:14.2320486Z     |
2020-03-17T18:43:14.2321455Z 191 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2322991Z 
2020-03-17T18:43:14.2323463Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2324221Z    --> src/librustc/query/mod.rs:204:30
2020-03-17T18:43:14.2324884Z     |
2020-03-17T18:43:14.2324884Z     |
2020-03-17T18:43:14.2325422Z 204 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2326765Z 
2020-03-17T18:43:14.2327206Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2327953Z    --> src/librustc/query/mod.rs:399:30
2020-03-17T18:43:14.2328400Z     |
2020-03-17T18:43:14.2328400Z     |
2020-03-17T18:43:14.2328957Z 399 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2331181Z 
2020-03-17T18:43:14.2331671Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2332381Z    --> src/librustc/query/mod.rs:469:30
2020-03-17T18:43:14.2333022Z     |
2020-03-17T18:43:14.2333022Z     |
2020-03-17T18:43:14.2334169Z 469 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2336378Z 
2020-03-17T18:43:14.2336908Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2337880Z    --> src/librustc/query/mod.rs:472:30
2020-03-17T18:43:14.2338485Z     |
2020-03-17T18:43:14.2338485Z     |
2020-03-17T18:43:14.2339056Z 472 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2340750Z 
2020-03-17T18:43:14.2341253Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2346804Z    --> src/librustc/query/mod.rs:485:30
2020-03-17T18:43:14.2347585Z     |
2020-03-17T18:43:14.2347585Z     |
2020-03-17T18:43:14.2348353Z 485 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2349711Z 
2020-03-17T18:43:14.2403702Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2404330Z    --> src/librustc/query/mod.rs:593:30
2020-03-17T18:43:14.2404800Z     |
2020-03-17T18:43:14.2404800Z     |
2020-03-17T18:43:14.2405361Z 593 |             cache_on_disk_if { key.is_local() }
2020-03-17T18:43:14.2406671Z 
2020-03-17T18:43:14.2407125Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2407705Z    --> src/librustc/query/mod.rs:625:30
2020-03-17T18:43:14.2408796Z     |
2020-03-17T18:43:14.2408796Z     |
2020-03-17T18:43:14.2409430Z 625 |             cache_on_disk_if { true }
2020-03-17T18:43:14.2410694Z 
2020-03-17T18:43:14.2411153Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2411723Z    --> src/librustc/query/mod.rs:645:30
2020-03-17T18:43:14.2412173Z     |
2020-03-17T18:43:14.2412173Z     |
2020-03-17T18:43:14.2412704Z 645 |             cache_on_disk_if { true }
2020-03-17T18:43:14.2414105Z 
2020-03-17T18:43:14.2414598Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2415174Z    --> src/librustc/query/mod.rs:678:30
2020-03-17T18:43:14.2415622Z     |
2020-03-17T18:43:14.2415622Z     |
2020-03-17T18:43:14.2416234Z 678 |             cache_on_disk_if { true }
2020-03-17T18:43:14.2417673Z 
2020-03-17T18:43:14.2418116Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2418667Z    --> src/librustc/query/mod.rs:695:30
2020-03-17T18:43:14.2419111Z     |
2020-03-17T18:43:14.2419111Z     |
2020-03-17T18:43:14.2419626Z 695 |             cache_on_disk_if { true }
2020-03-17T18:43:14.2420827Z 
2020-03-17T18:43:14.2421272Z error: unnecessary parentheses around block return value
2020-03-17T18:43:14.2421828Z    --> src/librustc/query/mod.rs:731:30
2020-03-17T18:43:14.2422264Z     |
2020-03-17T18:43:14.2422264Z     |
2020-03-17T18:43:14.2422782Z 731 |             cache_on_disk_if { true }
2020-03-17T18:43:14.2423972Z 
2020-03-17T18:43:15.8920457Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-03-17T18:43:29.2253594Z error: aborting due to 16 previous errors
2020-03-17T18:43:29.2254669Z 
---
2020-03-17T18:43:49.1111989Z   local time: Tue Mar 17 18:43:49 UTC 2020
2020-03-17T18:43:49.4084228Z   network time: Tue, 17 Mar 2020 18:43:49 GMT
2020-03-17T18:43:49.4090120Z == end clock drift check ==
2020-03-17T18:43:49.9119142Z 
2020-03-17T18:43:49.9202582Z ##[error]Bash exited with code '1'.
2020-03-17T18:43:49.9216642Z ##[section]Finishing: Run build
2020-03-17T18:43:49.9269224Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-17T18:43:49.9274583Z Task         : Get sources
2020-03-17T18:43:49.9274939Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-17T18:43:49.9275417Z Version      : 1.0.0
2020-03-17T18:43:49.9275639Z Author       : Microsoft
2020-03-17T18:43:49.9275639Z Author       : Microsoft
2020-03-17T18:43:49.9276007Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-17T18:43:49.9276413Z ==============================================================================
2020-03-17T18:43:50.3085083Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-17T18:43:50.3145027Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-17T18:43:50.3234275Z Cleaning up task key
2020-03-17T18:43:50.3235469Z Start cleaning up orphan processes.
2020-03-17T18:43:50.3445934Z Terminate orphan process: pid (4268) (python)
2020-03-17T18:43:50.3640737Z ##[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 @rust-lang/infra. (Feature Requests)

@varkor
Copy link
Member

varkor commented Mar 17, 2020

I should think you could add a check_anon_const inside a visit_anon_const to EarlyContextAndPass

impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T> {

You'll need to update src/librustc_lint/passes.rs. After that, you can use the method inside impl EarlyLintPass for UnusedParens similarly to what you've already done.

@varkor varkor added the F-const_generics `#![feature(const_generics)]` label Mar 17, 2020
@lcnr
Copy link
Contributor Author

lcnr commented Mar 17, 2020

@petrochenkov it seems like unused_parens never actually visits addressof expressions: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=4f7d927326c626229ddbc94b96fc2e71

Still added a test so this does not go unnoticed in case this is extended later on.

@lcnr
Copy link
Contributor Author

lcnr commented Mar 17, 2020

I had to fix src/librustc_macros/src/query.rs, as it caused unused_parens warnings. (see highfive comment)

I originally thought that !value.span.from_expansion() would be enough to prevent this from happening.

Can someone who understands proc macros look at this and check if and how this lint should be fixed? @matklad?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-03-17T19:48:02.7723503Z ========================== Starting Command Output ===========================
2020-03-17T19:48:02.7725981Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/060dd11d-aab5-47c1-8a64-6adc593d0acc.sh
2020-03-17T19:48:02.7726332Z 
2020-03-17T19:48:02.7730717Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-17T19:48:02.7750374Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-17T19:48:02.7754320Z Task         : Get sources
2020-03-17T19:48:02.7754625Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-17T19:48:02.7754944Z Version      : 1.0.0
2020-03-17T19:48:02.7755144Z Author       : Microsoft
---
2020-03-17T19:48:03.7661394Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-17T19:48:03.7668452Z ##[command]git config gc.auto 0
2020-03-17T19:48:03.7673427Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-17T19:48:03.7678048Z ##[command]git config --get-all http.proxy
2020-03-17T19:48:03.7685444Z ##[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/70081/merge:refs/remotes/pull/70081/merge
---
2020-03-17T20:33:00.7891940Z    Compiling rustc_resolve v0.0.0 (/checkout/src/librustc_resolve)
2020-03-17T20:33:01.2365716Z error: unnecessary parentheses around method argument
2020-03-17T20:33:01.2366438Z     --> src/librustc_resolve/lib.rs:2806:28
2020-03-17T20:33:01.2366989Z      |
2020-03-17T20:33:01.2367812Z 2806 |                     .chain({ path_str.split("::").skip(1).map(Ident::from_str) })
2020-03-17T20:33:01.2369846Z      |
2020-03-17T20:33:01.2370679Z      = note: `-D unused-parens` implied by `-D warnings`
2020-03-17T20:33:01.2376264Z 
2020-03-17T20:33:02.7906779Z error: aborting due to previous error
---
2020-03-17T20:35:51.3591733Z   local time: Tue Mar 17 20:35:51 UTC 2020
2020-03-17T20:35:51.6487082Z   network time: Tue, 17 Mar 2020 20:35:51 GMT
2020-03-17T20:35:51.6494301Z == end clock drift check ==
2020-03-17T20:35:52.5492295Z 
2020-03-17T20:35:52.5560131Z ##[error]Bash exited with code '1'.
2020-03-17T20:35:52.5575660Z ##[section]Finishing: Run build
2020-03-17T20:35:52.5623306Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-17T20:35:52.5628315Z Task         : Get sources
2020-03-17T20:35:52.5628664Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-17T20:35:52.5628984Z Version      : 1.0.0
2020-03-17T20:35:52.5629225Z Author       : Microsoft
2020-03-17T20:35:52.5629225Z Author       : Microsoft
2020-03-17T20:35:52.5629581Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-17T20:35:52.5629992Z ==============================================================================
2020-03-17T20:35:52.9036567Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-17T20:35:52.9082465Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-17T20:35:52.9168798Z Cleaning up task key
2020-03-17T20:35:52.9170046Z Start cleaning up orphan processes.
2020-03-17T20:35:52.9374765Z Terminate orphan process: pid (3687) (python)
2020-03-17T20:35:52.9540009Z ##[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 @rust-lang/infra. (Feature Requests)

@lcnr lcnr force-pushed the issue68387 branch 2 times, most recently from bbacee5 to 4d1aec5 Compare March 17, 2020 23:22
@lcnr
Copy link
Contributor Author

lcnr commented Mar 17, 2020

When exactly do const generics require parentheses?

Should I only warn if the const expr is a Lit or a Path for now?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-03-17T23:30:08.3022611Z ========================== Starting Command Output ===========================
2020-03-17T23:30:08.3025196Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/5d1d75ba-4457-4fdf-8891-ef7bdf78f8a6.sh
2020-03-17T23:30:08.3025492Z 
2020-03-17T23:30:08.3029257Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-17T23:30:08.3049342Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-17T23:30:08.3052530Z Task         : Get sources
2020-03-17T23:30:08.3052849Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-17T23:30:08.3053149Z Version      : 1.0.0
2020-03-17T23:30:08.3053348Z Author       : Microsoft
---
2020-03-17T23:30:09.2986494Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-17T23:30:09.2994374Z ##[command]git config gc.auto 0
2020-03-17T23:30:09.2999150Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-17T23:30:09.3004885Z ##[command]git config --get-all http.proxy
2020-03-17T23:30:09.3013519Z ##[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/70081/merge:refs/remotes/pull/70081/merge
---
2020-03-18T00:24:32.5322458Z .................................................................................................... 1700/9800
2020-03-18T00:24:36.3332611Z .................................................................................................... 1800/9800
2020-03-18T00:24:46.4171121Z ............................................................................i....................... 1900/9800
2020-03-18T00:24:52.1481966Z .................................................................................................... 2000/9800
2020-03-18T00:24:59.2587898Z ..................................................................iiiii............................. 2100/9800
2020-03-18T00:25:15.5371461Z .................................................................................................... 2300/9800
2020-03-18T00:25:17.5555260Z .................................................................................................... 2400/9800
2020-03-18T00:25:20.0973256Z .................................................................................................... 2500/9800
2020-03-18T00:25:38.3282826Z .................................................................................................... 2600/9800
---
2020-03-18T00:27:55.6057469Z ......................................i...............i............................................. 5000/9800
2020-03-18T00:28:03.1334873Z .................................................................................................... 5100/9800
2020-03-18T00:28:08.6935811Z .................................................................................i.................. 5200/9800
2020-03-18T00:28:13.5072042Z .................................................................................................... 5300/9800
2020-03-18T00:28:22.2929339Z ..............................................................ii.ii........i...i.................... 5400/9800
2020-03-18T00:28:29.0258899Z .i.................................................................................................. 5600/9800
2020-03-18T00:28:36.8984855Z ..................................F................................................................. 5700/9800
2020-03-18T00:28:42.0932553Z .........................................................i.......................................... 5800/9800
2020-03-18T00:28:47.5395146Z .................................................................................................... 5900/9800
2020-03-18T00:28:47.5395146Z .................................................................................................... 5900/9800
2020-03-18T00:28:53.9626213Z .................................................................................................... 6000/9800
2020-03-18T00:29:00.4265406Z ...................................................ii...i..ii...........i........................... 6100/9800
2020-03-18T00:29:17.7863938Z .................................................................................................... 6300/9800
2020-03-18T00:29:21.2026317Z .................................................................................................... 6400/9800
2020-03-18T00:29:21.2026317Z .................................................................................................... 6400/9800
2020-03-18T00:29:24.3893908Z .................................................................................i..ii.............. 6500/9800
2020-03-18T00:29:44.2805875Z .................................................................................................... 6700/9800
2020-03-18T00:29:52.2978218Z ...............................................................................i.................... 6800/9800
2020-03-18T00:29:54.0968093Z .................................................................................................... 6900/9800
2020-03-18T00:29:55.8762201Z .................................................................................................... 7000/9800
---
2020-03-18T00:31:22.1331700Z .................................................................................................... 7800/9800
2020-03-18T00:31:26.6162200Z .................................................................................................... 7900/9800
2020-03-18T00:31:31.8534671Z .................................................................i.................................. 8000/9800
2020-03-18T00:31:40.3938646Z .................................................................................................... 8100/9800
2020-03-18T00:31:44.8261915Z ..............iiiiiiiiii.i.......................................................................... 8200/9800
2020-03-18T00:31:56.5794522Z .................................................................................................... 8400/9800
2020-03-18T00:32:03.1540404Z .................................................................................................... 8500/9800
2020-03-18T00:32:14.4584868Z .................................................................................................... 8600/9800
2020-03-18T00:32:19.8383542Z .................................................................................................... 8700/9800
---
2020-03-18T00:33:54.3771181Z normalized stderr:
2020-03-18T00:33:54.3771562Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3772303Z   --> $DIR/vec-fixed-length.rs:12:31
2020-03-18T00:33:54.3772671Z    |
2020-03-18T00:33:54.3773107Z LL |     assert_eq!(size_of::<[u8; (1 << 32)]>(), (1 << 32));
2020-03-18T00:33:54.3774098Z    |
2020-03-18T00:33:54.3774600Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3775039Z 
2020-03-18T00:33:54.3775254Z 
2020-03-18T00:33:54.3775254Z 
2020-03-18T00:33:54.3775478Z 
2020-03-18T00:33:54.3775917Z 
2020-03-18T00:33:54.3776221Z The actual stderr differed from the expected stderr.
2020-03-18T00:33:54.3777100Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/array-slice-vec/vec-fixed-length/vec-fixed-length.stderr
2020-03-18T00:33:54.3778112Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T00:33:54.3779546Z To only update this specific test, also pass `--test-args array-slice-vec/vec-fixed-length.rs`
2020-03-18T00:33:54.3782065Z error: 1 errors occurred comparing output.
2020-03-18T00:33:54.3782319Z status: exit code: 0
2020-03-18T00:33:54.3782319Z status: exit code: 0
2020-03-18T00:33:54.3784287Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/array-slice-vec/vec-fixed-length.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/array-slice-vec/vec-fixed-length/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/array-slice-vec/vec-fixed-length/auxiliary"
2020-03-18T00:33:54.3785850Z ------------------------------------------
2020-03-18T00:33:54.3786025Z 
2020-03-18T00:33:54.3786399Z ------------------------------------------
2020-03-18T00:33:54.3786600Z stderr:
2020-03-18T00:33:54.3786600Z stderr:
2020-03-18T00:33:54.3786967Z ------------------------------------------
2020-03-18T00:33:54.3787277Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3787832Z   --> /checkout/src/test/ui/array-slice-vec/vec-fixed-length.rs:12:31
2020-03-18T00:33:54.3788188Z    |
2020-03-18T00:33:54.3788429Z LL |     assert_eq!(size_of::<[u8; (1 << 32)]>(), (1 << 32));
2020-03-18T00:33:54.3789042Z    |
2020-03-18T00:33:54.3789253Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3789427Z 
2020-03-18T00:33:54.3789521Z 
---
2020-03-18T00:33:54.3791438Z 8 
2020-03-18T00:33:54.3791664Z + warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3792211Z +   --> $DIR/condition-in-trait-const-arg.rs:8:18
2020-03-18T00:33:54.3792395Z +    |
2020-03-18T00:33:54.3792577Z + LL | impl IsZeroTrait<{0u8 == 0u8}> for () {}
2020-03-18T00:33:54.3793264Z +    |
2020-03-18T00:33:54.3793481Z +    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3793679Z + 
2020-03-18T00:33:54.3793930Z 9 
2020-03-18T00:33:54.3793930Z 9 
2020-03-18T00:33:54.3794027Z 
2020-03-18T00:33:54.3794131Z 
2020-03-18T00:33:54.3794321Z The actual stderr differed from the expected stderr.
2020-03-18T00:33:54.3795094Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/condition-in-trait-const-arg/condition-in-trait-const-arg.stderr
2020-03-18T00:33:54.3795819Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T00:33:54.3796335Z To only update this specific test, also pass `--test-args const-generics/condition-in-trait-const-arg.rs`
2020-03-18T00:33:54.3796726Z error: 1 errors occurred comparing output.
2020-03-18T00:33:54.3796918Z status: exit code: 0
2020-03-18T00:33:54.3796918Z status: exit code: 0
2020-03-18T00:33:54.3798501Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/condition-in-trait-const-arg.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/condition-in-trait-const-arg/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/const-generics/condition-in-trait-const-arg/auxiliary"
2020-03-18T00:33:54.3799797Z ------------------------------------------
2020-03-18T00:33:54.3799951Z 
2020-03-18T00:33:54.3800241Z ------------------------------------------
2020-03-18T00:33:54.3800402Z stderr:
---
2020-03-18T00:33:54.3802556Z 
2020-03-18T00:33:54.3802734Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3803214Z   --> /checkout/src/test/ui/const-generics/condition-in-trait-const-arg.rs:8:18
2020-03-18T00:33:54.3803435Z    |
2020-03-18T00:33:54.3803598Z LL | impl IsZeroTrait<{0u8 == 0u8}> for () {}
2020-03-18T00:33:54.3804074Z    |
2020-03-18T00:33:54.3804433Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3804621Z 
2020-03-18T00:33:54.3804711Z 
---
2020-03-18T00:33:54.3806626Z 8 
2020-03-18T00:33:54.3806840Z + warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3807308Z +   --> $DIR/issue-62579-no-match.rs:14:11
2020-03-18T00:33:54.3807507Z +    |
2020-03-18T00:33:54.3807681Z + LL |     foo::<{NoMatch}>();
2020-03-18T00:33:54.3808184Z +    |
2020-03-18T00:33:54.3808390Z +    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3808600Z + 
2020-03-18T00:33:54.3808712Z 9 
2020-03-18T00:33:54.3808712Z 9 
2020-03-18T00:33:54.3808804Z 
2020-03-18T00:33:54.3808893Z 
2020-03-18T00:33:54.3809095Z The actual stderr differed from the expected stderr.
2020-03-18T00:33:54.3810651Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/issues/issue-62579-no-match/issue-62579-no-match.stderr
2020-03-18T00:33:54.3812196Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T00:33:54.3813003Z To only update this specific test, also pass `--test-args const-generics/issues/issue-62579-no-match.rs`
2020-03-18T00:33:54.3813505Z error: 1 errors occurred comparing output.
2020-03-18T00:33:54.3813767Z status: exit code: 0
2020-03-18T00:33:54.3813767Z status: exit code: 0
2020-03-18T00:33:54.3815823Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/issues/issue-62579-no-match.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/issues/issue-62579-no-match/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/const-generics/issues/issue-62579-no-match/auxiliary"
2020-03-18T00:33:54.3817517Z ------------------------------------------
2020-03-18T00:33:54.3817903Z 
2020-03-18T00:33:54.3818307Z ------------------------------------------
2020-03-18T00:33:54.3818514Z stderr:
---
2020-03-18T00:33:54.3821271Z 
2020-03-18T00:33:54.3821503Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3822110Z   --> /checkout/src/test/ui/const-generics/issues/issue-62579-no-match.rs:14:11
2020-03-18T00:33:54.3822410Z    |
2020-03-18T00:33:54.3822599Z LL |     foo::<{NoMatch}>();
2020-03-18T00:33:54.3823150Z    |
2020-03-18T00:33:54.3823376Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3823573Z 
2020-03-18T00:33:54.3823674Z 
---
2020-03-18T00:33:54.3825770Z 8 
2020-03-18T00:33:54.3825994Z + warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3826475Z +   --> $DIR/raw-ptr-const-param-deref.rs:18:24
2020-03-18T00:33:54.3826705Z +    |
2020-03-18T00:33:54.3826949Z + LL |     assert_eq!(Const::<{&A as *const _}>::get(), 3)
2020-03-18T00:33:54.3827616Z +    |
2020-03-18T00:33:54.3827831Z +    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3828035Z + 
2020-03-18T00:33:54.3828163Z 9 
2020-03-18T00:33:54.3828163Z 9 
2020-03-18T00:33:54.3828260Z 
2020-03-18T00:33:54.3828353Z 
2020-03-18T00:33:54.3828551Z The actual stderr differed from the expected stderr.
2020-03-18T00:33:54.3829271Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/raw-ptr-const-param-deref/raw-ptr-const-param-deref.stderr
2020-03-18T00:33:54.3829924Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T00:33:54.3830528Z To only update this specific test, also pass `--test-args const-generics/raw-ptr-const-param-deref.rs`
2020-03-18T00:33:54.3831068Z error: 1 errors occurred comparing output.
2020-03-18T00:33:54.3831297Z status: exit code: 0
2020-03-18T00:33:54.3831297Z status: exit code: 0
2020-03-18T00:33:54.3833251Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/raw-ptr-const-param-deref.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/raw-ptr-const-param-deref/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/const-generics/raw-ptr-const-param-deref/auxiliary"
2020-03-18T00:33:54.3834807Z ------------------------------------------
2020-03-18T00:33:54.3834970Z 
2020-03-18T00:33:54.3835302Z ------------------------------------------
2020-03-18T00:33:54.3835511Z stderr:
---
2020-03-18T00:33:54.3838217Z 
2020-03-18T00:33:54.3838405Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3838884Z   --> /checkout/src/test/ui/const-generics/raw-ptr-const-param-deref.rs:18:24
2020-03-18T00:33:54.3839113Z    |
2020-03-18T00:33:54.3839332Z LL |     assert_eq!(Const::<{&A as *const _}>::get(), 3)
2020-03-18T00:33:54.3840147Z    |
2020-03-18T00:33:54.3840367Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3840552Z 
2020-03-18T00:33:54.3840643Z 
---
2020-03-18T00:33:54.3842579Z 8 
2020-03-18T00:33:54.3842802Z + warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3843255Z +   --> $DIR/slice-const-param.rs:18:38
2020-03-18T00:33:54.3843465Z +    |
2020-03-18T00:33:54.3843748Z + LL |     assert_eq!(function_with_bytes::<{&[0x41, 0x41, 0x41, 0x41]}>(), b"AAAA");
2020-03-18T00:33:54.3844557Z +    |
2020-03-18T00:33:54.3844770Z +    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3844976Z + 
2020-03-18T00:33:54.3845092Z 9 
2020-03-18T00:33:54.3845092Z 9 
2020-03-18T00:33:54.3845202Z 
2020-03-18T00:33:54.3845294Z 
2020-03-18T00:33:54.3845493Z The actual stderr differed from the expected stderr.
2020-03-18T00:33:54.3846158Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/slice-const-param/slice-const-param.stderr
2020-03-18T00:33:54.3846800Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T00:33:54.3847594Z To only update this specific test, also pass `--test-args const-generics/slice-const-param.rs`
2020-03-18T00:33:54.3848086Z error: 1 errors occurred comparing output.
2020-03-18T00:33:54.3848333Z status: exit code: 0
2020-03-18T00:33:54.3848333Z status: exit code: 0
2020-03-18T00:33:54.3850357Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/slice-const-param.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/slice-const-param/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/const-generics/slice-const-param/auxiliary"
2020-03-18T00:33:54.3852040Z ------------------------------------------
2020-03-18T00:33:54.3852217Z 
2020-03-18T00:33:54.3852576Z ------------------------------------------
2020-03-18T00:33:54.3852781Z stderr:
---
2020-03-18T00:33:54.3855494Z 
2020-03-18T00:33:54.3855737Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3856307Z   --> /checkout/src/test/ui/const-generics/slice-const-param.rs:18:38
2020-03-18T00:33:54.3856572Z    |
2020-03-18T00:33:54.3856883Z LL |     assert_eq!(function_with_bytes::<{&[0x41, 0x41, 0x41, 0x41]}>(), b"AAAA");
2020-03-18T00:33:54.3861914Z    |
2020-03-18T00:33:54.3862182Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3862384Z 
2020-03-18T00:33:54.3862485Z 
2020-03-18T00:33:54.3862485Z 
2020-03-18T00:33:54.3863088Z ------------------------------------------
2020-03-18T00:33:54.3863267Z 
2020-03-18T00:33:54.3863384Z 
2020-03-18T00:33:54.3863803Z ---- [ui] ui/const-generics/unused_parens.rs stdout ----
2020-03-18T00:33:54.3864017Z 
2020-03-18T00:33:54.3864422Z error: test compilation failed although it shouldn't!
2020-03-18T00:33:54.3864711Z status: exit code: 1
2020-03-18T00:33:54.3866759Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/unused_parens.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/unused_parens" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/unused_parens/auxiliary"
2020-03-18T00:33:54.3868498Z ------------------------------------------
2020-03-18T00:33:54.3868666Z 
2020-03-18T00:33:54.3869046Z ------------------------------------------
2020-03-18T00:33:54.3869251Z stderr:
2020-03-18T00:33:54.3869251Z stderr:
2020-03-18T00:33:54.3871977Z ------------------------------------------
2020-03-18T00:33:54.3872487Z error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
2020-03-18T00:33:54.3873326Z    |
2020-03-18T00:33:54.3873326Z    |
2020-03-18T00:33:54.3873538Z LL | struct A<const N: usize = { 7 }> {
2020-03-18T00:33:54.3873834Z    |                         ^ expected one of 7 possible tokens
2020-03-18T00:33:54.3874223Z error: aborting due to previous error
2020-03-18T00:33:54.3874383Z 
2020-03-18T00:33:54.3874476Z 
2020-03-18T00:33:54.3874810Z ------------------------------------------
2020-03-18T00:33:54.3874810Z ------------------------------------------
2020-03-18T00:33:54.3874972Z 
2020-03-18T00:33:54.3875080Z 
2020-03-18T00:33:54.3875568Z ---- [ui] ui/issues/issue-23898.rs stdout ----
2020-03-18T00:33:54.3875795Z normalized stderr:
2020-03-18T00:33:54.3876062Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3876564Z   --> $DIR/issue-23898.rs:9:22
2020-03-18T00:33:54.3876742Z    |
2020-03-18T00:33:54.3876991Z LL |     [State::ST_NULL; (State::ST_WHITESPACE as usize)];
2020-03-18T00:33:54.3877683Z    |
2020-03-18T00:33:54.3877893Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3878090Z 
2020-03-18T00:33:54.3878182Z 
2020-03-18T00:33:54.3878182Z 
2020-03-18T00:33:54.3878274Z 
2020-03-18T00:33:54.3878366Z 
2020-03-18T00:33:54.3878578Z The actual stderr differed from the expected stderr.
2020-03-18T00:33:54.3879200Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-23898/issue-23898.stderr
2020-03-18T00:33:54.3879797Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T00:33:54.3880368Z To only update this specific test, also pass `--test-args issues/issue-23898.rs`
2020-03-18T00:33:54.3880791Z error: 1 errors occurred comparing output.
2020-03-18T00:33:54.3881019Z status: exit code: 0
2020-03-18T00:33:54.3881019Z status: exit code: 0
2020-03-18T00:33:54.3882754Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-23898.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-23898/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/issues/issue-23898/auxiliary"
2020-03-18T00:33:54.3884198Z ------------------------------------------
2020-03-18T00:33:54.3884362Z 
2020-03-18T00:33:54.3884700Z ------------------------------------------
2020-03-18T00:33:54.3884907Z stderr:
2020-03-18T00:33:54.3884907Z stderr:
2020-03-18T00:33:54.3885406Z ------------------------------------------
2020-03-18T00:33:54.3886617Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3887218Z   --> /checkout/src/test/ui/issues/issue-23898.rs:9:22
2020-03-18T00:33:54.3887442Z    |
2020-03-18T00:33:54.3888332Z LL |     [State::ST_NULL; (State::ST_WHITESPACE as usize)];
2020-03-18T00:33:54.3889261Z    |
2020-03-18T00:33:54.3889472Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T00:33:54.3889675Z 
2020-03-18T00:33:54.3889768Z 
2020-03-18T00:33:54.3889768Z 
2020-03-18T00:33:54.3890164Z ------------------------------------------
2020-03-18T00:33:54.3890327Z 
2020-03-18T00:33:54.3890436Z 
2020-03-18T00:33:54.3890798Z ---- [ui] ui/lint/unused_parens_brace.rs stdout ----
2020-03-18T00:33:54.3891026Z diff of stderr:
2020-03-18T00:33:54.3896861Z 
2020-03-18T00:33:54.3897075Z 22 LL |     if let 7 = { 7 } {
2020-03-18T00:33:54.3897700Z 24 
2020-03-18T00:33:54.3897949Z + warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3904053Z +   --> $DIR/unused_parens_brace.rs:26:17
2020-03-18T00:33:54.3904283Z +    |
2020-03-18T00:33:54.3904283Z +    |
2020-03-18T00:33:54.3904494Z + LL |     let _: [u8; { 7 }];
2020-03-18T00:33:54.3905005Z + 
2020-03-18T00:33:54.3905122Z 25 
2020-03-18T00:33:54.3905239Z 
2020-03-18T00:33:54.3905334Z 
2020-03-18T00:33:54.3905334Z 
2020-03-18T00:33:54.3905536Z The actual stderr differed from the expected stderr.
2020-03-18T00:33:54.3906220Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/unused_parens_brace/unused_parens_brace.stderr
2020-03-18T00:33:54.3906855Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T00:33:54.3907574Z To only update this specific test, also pass `--test-args lint/unused_parens_brace.rs`
2020-03-18T00:33:54.3908100Z error: 1 errors occurred comparing output.
2020-03-18T00:33:54.3908330Z status: exit code: 0
2020-03-18T00:33:54.3908330Z status: exit code: 0
2020-03-18T00:33:54.3910528Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lint/unused_parens_brace.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/unused_parens_brace" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/unused_parens_brace/auxiliary"
2020-03-18T00:33:54.3912318Z ------------------------------------------
2020-03-18T00:33:54.3912499Z 
2020-03-18T00:33:54.3912863Z ------------------------------------------
2020-03-18T00:33:54.3913069Z stderr:
---
2020-03-18T00:33:54.3918462Z 
2020-03-18T00:33:54.3918713Z warning: unnecessary parentheses around `let` head expression
2020-03-18T00:33:54.3919266Z   --> /checkout/src/test/ui/lint/unused_parens_brace.rs:22:16
2020-03-18T00:33:54.3919517Z    |
2020-03-18T00:33:54.3919707Z LL |     if let 7 = { 7 } {
2020-03-18T00:33:54.3920207Z 
2020-03-18T00:33:54.3920441Z warning: unnecessary parentheses around constant expression
2020-03-18T00:33:54.3920999Z   --> /checkout/src/test/ui/lint/unused_parens_brace.rs:26:17
2020-03-18T00:33:54.3921249Z    |
2020-03-18T00:33:54.3921249Z    |
2020-03-18T00:33:54.3921435Z LL |     let _: [u8; { 7 }];
2020-03-18T00:33:54.3921971Z 
2020-03-18T00:33:54.3922072Z 
2020-03-18T00:33:54.3922434Z ------------------------------------------
2020-03-18T00:33:54.3922622Z 
---
2020-03-18T00:33:54.3927230Z test result: FAILED. 9735 passed; 8 failed; 57 ignored; 0 measured; 0 filtered out
2020-03-18T00:33:54.3927575Z 
2020-03-18T00:33:54.3929361Z 
2020-03-18T00:33:54.3929541Z 
2020-03-18T00:33:54.3933498Z 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-7/bin/FileCheck" "--nodejs" "/usr/bin/node" "--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" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-18T00:33:54.3936781Z 
2020-03-18T00:33:54.3936886Z 
2020-03-18T00:33:54.3937575Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-03-18T00:33:54.3938239Z Build completed unsuccessfully in 0:59:20
2020-03-18T00:33:54.3938239Z Build completed unsuccessfully in 0:59:20
2020-03-18T00:33:54.3938982Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-18T00:33:54.3939533Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-18T00:33:54.3939942Z == clock drift check ==
2020-03-18T00:33:54.3940649Z   local time: Wed Mar 18 00:33:54 UTC 2020
2020-03-18T00:33:54.6852378Z   network time: Wed, 18 Mar 2020 00:33:54 GMT
2020-03-18T00:33:54.6852831Z == end clock drift check ==
2020-03-18T00:33:55.2404499Z 
2020-03-18T00:33:55.2465159Z ##[error]Bash exited with code '1'.
2020-03-18T00:33:55.2478939Z ##[section]Finishing: Run build
2020-03-18T00:33:55.2539390Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T00:33:55.2544416Z Task         : Get sources
2020-03-18T00:33:55.2544759Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-18T00:33:55.2545073Z Version      : 1.0.0
2020-03-18T00:33:55.2545307Z Author       : Microsoft
2020-03-18T00:33:55.2545307Z Author       : Microsoft
2020-03-18T00:33:55.2545661Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-18T00:33:55.2546061Z ==============================================================================
2020-03-18T00:33:55.5311361Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-18T00:33:55.5318557Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T00:33:55.5394327Z Cleaning up task key
2020-03-18T00:33:55.5395276Z Start cleaning up orphan processes.
2020-03-18T00:33:55.5656235Z Terminate orphan process: pid (3649) (python)
2020-03-18T00:33:55.5702475Z ##[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 @rust-lang/infra. (Feature Requests)

@varkor
Copy link
Member

varkor commented Mar 18, 2020

The RFC is not entirely precise. For now, we just accept literals and paths though, yes.

@lcnr
Copy link
Contributor Author

lcnr commented Mar 18, 2020

The following test currently causes unused_parens and I am not sure how to fix this.

Changed it so I only warn on Lit in anon const for now.

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash

#[derive(PartialEq, Eq)]
struct NoMatch;

fn foo<const T: NoMatch>() -> bool {
    true
}

fn main() {
    foo::<{ NoMatch }>(); // removing these brackets causes the compilation to fail
}

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-03-18T08:02:09.3390547Z ========================== Starting Command Output ===========================
2020-03-18T08:02:09.3393904Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/74bc7dc4-a4e8-41b5-8d58-6c2d38d2f566.sh
2020-03-18T08:02:09.3394315Z 
2020-03-18T08:02:09.3398620Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-18T08:02:09.3413704Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T08:02:09.3416023Z Task         : Get sources
2020-03-18T08:02:09.3416251Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-18T08:02:09.3416463Z Version      : 1.0.0
2020-03-18T08:02:09.3416602Z Author       : Microsoft
---
2020-03-18T08:02:10.3360350Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-18T08:02:10.3364948Z ##[command]git config gc.auto 0
2020-03-18T08:02:10.3367867Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-18T08:02:10.3370544Z ##[command]git config --get-all http.proxy
2020-03-18T08:02:10.3375418Z ##[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/70081/merge:refs/remotes/pull/70081/merge
---
2020-03-18T08:48:35.4008460Z .................................................................................................... 1700/9800
2020-03-18T08:48:39.1701741Z .................................................................................................... 1800/9800
2020-03-18T08:48:48.9150097Z ............................................................................i....................... 1900/9800
2020-03-18T08:48:54.4011044Z .................................................................................................... 2000/9800
2020-03-18T08:49:00.8984177Z ..................................................................iiiii............................. 2100/9800
2020-03-18T08:49:16.3887506Z .................................................................................................... 2300/9800
2020-03-18T08:49:18.3150137Z .................................................................................................... 2400/9800
2020-03-18T08:49:20.7673690Z .................................................................................................... 2500/9800
2020-03-18T08:49:37.6213273Z .................................................................................................... 2600/9800
---
2020-03-18T08:51:48.6370177Z ......................................i...............i............................................. 5000/9800
2020-03-18T08:51:56.0701453Z .................................................................................................... 5100/9800
2020-03-18T08:52:01.2049585Z .................................................................................i.................. 5200/9800
2020-03-18T08:52:05.6967266Z .................................................................................................... 5300/9800
2020-03-18T08:52:14.0343326Z ..............................................................ii.ii........i...i.................... 5400/9800
2020-03-18T08:52:20.6645924Z .i................................................................................................F. 5600/9800
2020-03-18T08:52:28.4913300Z ..................................F................................................................. 5700/9800
2020-03-18T08:52:33.6803837Z .........................................................i.......................................... 5800/9800
2020-03-18T08:52:39.1216868Z .................................................................................................... 5900/9800
2020-03-18T08:52:39.1216868Z .................................................................................................... 5900/9800
2020-03-18T08:52:45.6107279Z .................................................................................................... 6000/9800
2020-03-18T08:52:52.3027485Z ...................................................ii...i..ii...........i........................... 6100/9800
2020-03-18T08:53:07.8942578Z .................................................................................................... 6300/9800
2020-03-18T08:53:10.8325068Z .................................................................................................... 6400/9800
2020-03-18T08:53:10.8325068Z .................................................................................................... 6400/9800
2020-03-18T08:53:13.9922051Z .................................................................................i..ii.............. 6500/9800
2020-03-18T08:53:32.5194222Z .................................................................................................... 6700/9800
2020-03-18T08:53:40.0390455Z ...............................................................................i.................... 6800/9800
2020-03-18T08:53:41.7665094Z .................................................................................................... 6900/9800
2020-03-18T08:53:43.4995138Z .................................................................................................... 7000/9800
---
2020-03-18T08:55:06.1155680Z .................................................................................................... 7800/9800
2020-03-18T08:55:10.4372412Z .................................................................................................... 7900/9800
2020-03-18T08:55:15.2380708Z .................................................................i.................................. 8000/9800
2020-03-18T08:55:23.5830714Z .................................................................................................... 8100/9800
2020-03-18T08:55:27.9638403Z ..............iiiiiiiiii.i.......................................................................... 8200/9800
2020-03-18T08:55:39.1879351Z .................................................................................................... 8400/9800
2020-03-18T08:55:45.3213014Z .................................................................................................... 8500/9800
2020-03-18T08:55:56.2396648Z .................................................................................................... 8600/9800
2020-03-18T08:56:01.4209443Z .................................................................................................... 8700/9800
---
2020-03-18T08:57:32.6689986Z normalized stderr:
2020-03-18T08:57:32.6690314Z warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6690798Z   --> $DIR/vec-fixed-length.rs:12:31
2020-03-18T08:57:32.6691073Z    |
2020-03-18T08:57:32.6691385Z LL |     assert_eq!(size_of::<[u8; (1 << 32)]>(), (1 << 32));
2020-03-18T08:57:32.6692099Z    |
2020-03-18T08:57:32.6692371Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T08:57:32.6692616Z 
2020-03-18T08:57:32.6692798Z 
2020-03-18T08:57:32.6692798Z 
2020-03-18T08:57:32.6692995Z 
2020-03-18T08:57:32.6693175Z 
2020-03-18T08:57:32.6693438Z The actual stderr differed from the expected stderr.
2020-03-18T08:57:32.6694088Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/array-slice-vec/vec-fixed-length/vec-fixed-length.stderr
2020-03-18T08:57:32.6694697Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T08:57:32.6695689Z To only update this specific test, also pass `--test-args array-slice-vec/vec-fixed-length.rs`
2020-03-18T08:57:32.6696252Z error: 1 errors occurred comparing output.
2020-03-18T08:57:32.6696496Z status: exit code: 0
2020-03-18T08:57:32.6696496Z status: exit code: 0
2020-03-18T08:57:32.6698100Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/array-slice-vec/vec-fixed-length.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/array-slice-vec/vec-fixed-length/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/array-slice-vec/vec-fixed-length/auxiliary"
2020-03-18T08:57:32.6699515Z ------------------------------------------
2020-03-18T08:57:32.6699730Z 
2020-03-18T08:57:32.6700075Z ------------------------------------------
2020-03-18T08:57:32.6707836Z stderr:
2020-03-18T08:57:32.6707836Z stderr:
2020-03-18T08:57:32.6708443Z ------------------------------------------
2020-03-18T08:57:32.6708773Z warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6709269Z   --> /checkout/src/test/ui/array-slice-vec/vec-fixed-length.rs:12:31
2020-03-18T08:57:32.6709541Z    |
2020-03-18T08:57:32.6709807Z LL |     assert_eq!(size_of::<[u8; (1 << 32)]>(), (1 << 32));
2020-03-18T08:57:32.6710431Z    |
2020-03-18T08:57:32.6710676Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T08:57:32.6710885Z 
2020-03-18T08:57:32.6711029Z 
---
2020-03-18T08:57:32.6716568Z 8 
2020-03-18T08:57:32.6716952Z + warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6717765Z +   --> $DIR/issue-62579-no-match.rs:14:11
2020-03-18T08:57:32.6718112Z +    |
2020-03-18T08:57:32.6718431Z + LL |     foo::<{NoMatch}>();
2020-03-18T08:57:32.6729325Z +    |
2020-03-18T08:57:32.6729516Z +    = note: `#[warn(unused_parens)]` on by default
2020-03-18T08:57:32.6729684Z + 
2020-03-18T08:57:32.6729771Z 9 
2020-03-18T08:57:32.6729771Z 9 
2020-03-18T08:57:32.6729844Z 
2020-03-18T08:57:32.6729912Z 
2020-03-18T08:57:32.6730081Z The actual stderr differed from the expected stderr.
2020-03-18T08:57:32.6730782Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/issues/issue-62579-no-match/issue-62579-no-match.stderr
2020-03-18T08:57:32.6731288Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T08:57:32.6731742Z To only update this specific test, also pass `--test-args const-generics/issues/issue-62579-no-match.rs`
2020-03-18T08:57:32.6732074Z error: 1 errors occurred comparing output.
2020-03-18T08:57:32.6732257Z status: exit code: 0
2020-03-18T08:57:32.6732257Z status: exit code: 0
2020-03-18T08:57:32.6733647Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/issues/issue-62579-no-match.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/issues/issue-62579-no-match/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/const-generics/issues/issue-62579-no-match/auxiliary"
2020-03-18T08:57:32.6734789Z ------------------------------------------
2020-03-18T08:57:32.6734925Z 
2020-03-18T08:57:32.6735177Z ------------------------------------------
2020-03-18T08:57:32.6735321Z stderr:
---
2020-03-18T08:57:32.6737319Z 
2020-03-18T08:57:32.6737476Z warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6737970Z   --> /checkout/src/test/ui/const-generics/issues/issue-62579-no-match.rs:14:11
2020-03-18T08:57:32.6738161Z    |
2020-03-18T08:57:32.6738288Z LL |     foo::<{NoMatch}>();
2020-03-18T08:57:32.6738665Z    |
2020-03-18T08:57:32.6738817Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T08:57:32.6738949Z 
2020-03-18T08:57:32.6739031Z 
2020-03-18T08:57:32.6739031Z 
2020-03-18T08:57:32.6739283Z ------------------------------------------
2020-03-18T08:57:32.6739403Z 
2020-03-18T08:57:32.6739472Z 
2020-03-18T08:57:32.6739760Z ---- [ui] ui/const-generics/unused_parens.rs stdout ----
2020-03-18T08:57:32.6739896Z 
2020-03-18T08:57:32.6740407Z error: test compilation failed although it shouldn't!
2020-03-18T08:57:32.6740590Z status: exit code: 1
2020-03-18T08:57:32.6741983Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/unused_parens.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/unused_parens" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/unused_parens/auxiliary"
2020-03-18T08:57:32.6743108Z ------------------------------------------
2020-03-18T08:57:32.6743229Z 
2020-03-18T08:57:32.6743479Z ------------------------------------------
2020-03-18T08:57:32.6743634Z stderr:
2020-03-18T08:57:32.6743634Z stderr:
2020-03-18T08:57:32.6743893Z ------------------------------------------
2020-03-18T08:57:32.6744132Z error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
2020-03-18T08:57:32.6744728Z    |
2020-03-18T08:57:32.6744728Z    |
2020-03-18T08:57:32.6744868Z LL | struct A<const N: usize = { 7 }> {
2020-03-18T08:57:32.6745096Z    |                         ^ expected one of 7 possible tokens
2020-03-18T08:57:32.6745369Z error: aborting due to previous error
2020-03-18T08:57:32.6745485Z 
2020-03-18T08:57:32.6745567Z 
2020-03-18T08:57:32.6745815Z ------------------------------------------
2020-03-18T08:57:32.6745815Z ------------------------------------------
2020-03-18T08:57:32.6746056Z 
2020-03-18T08:57:32.6746125Z 
2020-03-18T08:57:32.6746408Z ---- [ui] ui/issues/issue-23898.rs stdout ----
2020-03-18T08:57:32.6746570Z normalized stderr:
2020-03-18T08:57:32.6746741Z warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6747069Z   --> $DIR/issue-23898.rs:9:22
2020-03-18T08:57:32.6747197Z    |
2020-03-18T08:57:32.6747370Z LL |     [State::ST_NULL; (State::ST_WHITESPACE as usize)];
2020-03-18T08:57:32.6747890Z    |
2020-03-18T08:57:32.6748041Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T08:57:32.6748172Z 
2020-03-18T08:57:32.6748255Z 
2020-03-18T08:57:32.6748255Z 
2020-03-18T08:57:32.6748323Z 
2020-03-18T08:57:32.6748390Z 
2020-03-18T08:57:32.6748534Z The actual stderr differed from the expected stderr.
2020-03-18T08:57:32.6748999Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-23898/issue-23898.stderr
2020-03-18T08:57:32.6749433Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T08:57:32.6749834Z To only update this specific test, also pass `--test-args issues/issue-23898.rs`
2020-03-18T08:57:32.6750149Z error: 1 errors occurred comparing output.
2020-03-18T08:57:32.6750315Z status: exit code: 0
2020-03-18T08:57:32.6750315Z status: exit code: 0
2020-03-18T08:57:32.6751634Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-23898.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-23898/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/issues/issue-23898/auxiliary"
2020-03-18T08:57:32.6752731Z ------------------------------------------
2020-03-18T08:57:32.6752855Z 
2020-03-18T08:57:32.6753105Z ------------------------------------------
2020-03-18T08:57:32.6753244Z stderr:
2020-03-18T08:57:32.6753244Z stderr:
2020-03-18T08:57:32.6753515Z ------------------------------------------
2020-03-18T08:57:32.6753717Z warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6754068Z   --> /checkout/src/test/ui/issues/issue-23898.rs:9:22
2020-03-18T08:57:32.6754242Z    |
2020-03-18T08:57:32.6754417Z LL |     [State::ST_NULL; (State::ST_WHITESPACE as usize)];
2020-03-18T08:57:32.6754932Z    |
2020-03-18T08:57:32.6755084Z    = note: `#[warn(unused_parens)]` on by default
2020-03-18T08:57:32.6755214Z 
2020-03-18T08:57:32.6755297Z 
---
2020-03-18T08:57:32.6758196Z - error: unnecessary parentheses around `return` value
2020-03-18T08:57:32.6758411Z + error: unnecessary parentheses around return value
2020-03-18T08:57:32.6758931Z 14   --> $DIR/lint-unnecessary-parens.rs:13:12
2020-03-18T08:57:32.6759113Z 15    |
2020-03-18T08:57:32.6759259Z 16 LL |     return (X { y });
2020-03-18T08:57:32.6759479Z 
2020-03-18T08:57:32.6759645Z The actual stderr differed from the expected stderr.
2020-03-18T08:57:32.6760210Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/lint-unnecessary-parens/lint-unnecessary-parens.stderr
2020-03-18T08:57:32.6760210Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/lint-unnecessary-parens/lint-unnecessary-parens.stderr
2020-03-18T08:57:32.6760761Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T08:57:32.6761248Z To only update this specific test, also pass `--test-args lint/lint-unnecessary-parens.rs`
2020-03-18T08:57:32.6761632Z error: 1 errors occurred comparing output.
2020-03-18T08:57:32.6761823Z status: exit code: 1
2020-03-18T08:57:32.6761823Z status: exit code: 1
2020-03-18T08:57:32.6763404Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lint/lint-unnecessary-parens.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/lint-unnecessary-parens" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/lint-unnecessary-parens/auxiliary"
2020-03-18T08:57:32.6765102Z ------------------------------------------
2020-03-18T08:57:32.6765302Z 
2020-03-18T08:57:32.6765789Z ------------------------------------------
2020-03-18T08:57:32.6766002Z stderr:
---
2020-03-18T08:57:32.6770952Z 
2020-03-18T08:57:32.6771279Z error: unnecessary parentheses around return value
2020-03-18T08:57:32.6771981Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:13:12
2020-03-18T08:57:32.6772483Z    |
2020-03-18T08:57:32.6772780Z LL |     return (X { y }); //~ ERROR unnecessary parentheses around `return` value
2020-03-18T08:57:32.6773496Z 
2020-03-18T08:57:32.6773690Z error: unnecessary parentheses around type
2020-03-18T08:57:32.6774384Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:16:42
2020-03-18T08:57:32.6774768Z    |
2020-03-18T08:57:32.6774768Z    |
2020-03-18T08:57:32.6775436Z LL | fn unused_parens_around_return_type() -> (u32) { //~ ERROR unnecessary parentheses around type
2020-03-18T08:57:32.6776191Z 
2020-03-18T08:57:32.6776407Z error: unnecessary parentheses around block return value
2020-03-18T08:57:32.6776991Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:22:9
2020-03-18T08:57:32.6777240Z    |
---
2020-03-18T08:57:32.6784931Z 
2020-03-18T08:57:32.6785114Z error: unnecessary parentheses around function argument
2020-03-18T08:57:32.6785560Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:46:9
2020-03-18T08:57:32.6785761Z    |
2020-03-18T08:57:32.6785995Z LL |     bar((true)); //~ ERROR unnecessary parentheses around function argument
2020-03-18T08:57:32.6786444Z 
2020-03-18T08:57:32.6786614Z error: unnecessary parentheses around `if` condition
2020-03-18T08:57:32.6787164Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:48:8
2020-03-18T08:57:32.6787370Z    |
---
2020-03-18T08:57:32.6791284Z    |
2020-03-18T08:57:32.6791506Z LL |     while (true) {} //~ ERROR unnecessary parentheses around `while` condition
2020-03-18T08:57:32.6791787Z    |     ^^^^^^^^^^^^ help: use `loop`
2020-03-18T08:57:32.6792078Z    |
2020-03-18T08:57:32.6792251Z    = note: `#[warn(while_true)]` on by default
2020-03-18T08:57:32.6792601Z error: unnecessary parentheses around `match` head expression
2020-03-18T08:57:32.6793191Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:51:11
2020-03-18T08:57:32.6793400Z    |
2020-03-18T08:57:32.6793400Z    |
2020-03-18T08:57:32.6793643Z LL |     match (true) { //~ ERROR unnecessary parentheses around `match` head expression
2020-03-18T08:57:32.6794596Z 
2020-03-18T08:57:32.6794823Z error: unnecessary parentheses around `let` head expression
2020-03-18T08:57:32.6795433Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:54:16
2020-03-18T08:57:32.6795686Z    |
2020-03-18T08:57:32.6795686Z    |
2020-03-18T08:57:32.6795967Z LL |     if let 1 = (1) {} //~ ERROR unnecessary parentheses around `let` head expression
2020-03-18T08:57:32.6796589Z 
2020-03-18T08:57:32.6796812Z error: unnecessary parentheses around `let` head expression
2020-03-18T08:57:32.6797374Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:55:19
2020-03-18T08:57:32.6797627Z    |
2020-03-18T08:57:32.6797627Z    |
2020-03-18T08:57:32.6797913Z LL |     while let 1 = (2) {} //~ ERROR unnecessary parentheses around `let` head expression
2020-03-18T08:57:32.6798533Z 
2020-03-18T08:57:32.6798743Z error: unnecessary parentheses around method argument
2020-03-18T08:57:32.6799276Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:69:24
2020-03-18T08:57:32.6799543Z    |
2020-03-18T08:57:32.6799543Z    |
2020-03-18T08:57:32.6799839Z LL |     X { y: false }.foo((true)); //~ ERROR unnecessary parentheses around method argument
2020-03-18T08:57:32.6800504Z 
2020-03-18T08:57:32.6800719Z error: unnecessary parentheses around assigned value
2020-03-18T08:57:32.6801259Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:71:18
2020-03-18T08:57:32.6801526Z    |
---
2020-03-18T08:57:32.6804365Z 
2020-03-18T08:57:32.6805337Z error: unnecessary parentheses around assigned value
2020-03-18T08:57:32.6806092Z   --> /checkout/src/test/ui/lint/lint-unnecessary-parens.rs:73:11
2020-03-18T08:57:32.6806453Z    |
2020-03-18T08:57:32.6806714Z LL |     _a += (1); //~ ERROR unnecessary parentheses around assigned value
2020-03-18T08:57:32.6807326Z 
2020-03-18T08:57:32.6807605Z error: aborting due to 17 previous errors
2020-03-18T08:57:32.6808188Z 
2020-03-18T08:57:32.6808291Z 
2020-03-18T08:57:32.6808291Z 
2020-03-18T08:57:32.6809119Z ------------------------------------------
2020-03-18T08:57:32.6809299Z 
2020-03-18T08:57:32.6809396Z 
2020-03-18T08:57:32.6809810Z ---- [ui] ui/lint/unused_parens_brace.rs stdout ----
2020-03-18T08:57:32.6810048Z diff of stderr:
2020-03-18T08:57:32.6810172Z 
2020-03-18T08:57:32.6810345Z 22 LL |     if let 7 = { 7 } {
2020-03-18T08:57:32.6811138Z 24 
2020-03-18T08:57:32.6811365Z + warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6811885Z +   --> $DIR/unused_parens_brace.rs:26:17
2020-03-18T08:57:32.6812109Z +    |
2020-03-18T08:57:32.6812109Z +    |
2020-03-18T08:57:32.6812301Z + LL |     let _: [u8; { 7 }];
2020-03-18T08:57:32.6812866Z + 
2020-03-18T08:57:32.6812992Z 25 
2020-03-18T08:57:32.6813097Z 
2020-03-18T08:57:32.6813212Z 
2020-03-18T08:57:32.6813212Z 
2020-03-18T08:57:32.6813421Z The actual stderr differed from the expected stderr.
2020-03-18T08:57:32.6814109Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/unused_parens_brace/unused_parens_brace.stderr
2020-03-18T08:57:32.6814773Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T08:57:32.6815367Z To only update this specific test, also pass `--test-args lint/unused_parens_brace.rs`
2020-03-18T08:57:32.6815961Z error: 1 errors occurred comparing output.
2020-03-18T08:57:32.6816199Z status: exit code: 0
2020-03-18T08:57:32.6816199Z status: exit code: 0
2020-03-18T08:57:32.6818249Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lint/unused_parens_brace.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/unused_parens_brace" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/unused_parens_brace/auxiliary"
2020-03-18T08:57:32.6819860Z ------------------------------------------
2020-03-18T08:57:32.6820056Z 
2020-03-18T08:57:32.6820643Z ------------------------------------------
2020-03-18T08:57:32.6820846Z stderr:
---
2020-03-18T08:57:32.6826084Z 
2020-03-18T08:57:32.6826310Z warning: unnecessary parentheses around `let` head expression
2020-03-18T08:57:32.6826972Z   --> /checkout/src/test/ui/lint/unused_parens_brace.rs:22:16
2020-03-18T08:57:32.6827222Z    |
2020-03-18T08:57:32.6827450Z LL |     if let 7 = { 7 } {
2020-03-18T08:57:32.6828199Z 
2020-03-18T08:57:32.6828399Z warning: unnecessary parentheses around const expression
2020-03-18T08:57:32.6828930Z   --> /checkout/src/test/ui/lint/unused_parens_brace.rs:26:17
2020-03-18T08:57:32.6829154Z    |
2020-03-18T08:57:32.6829154Z    |
2020-03-18T08:57:32.6829325Z LL |     let _: [u8; { 7 }];
2020-03-18T08:57:32.6829804Z 
2020-03-18T08:57:32.6829894Z 
2020-03-18T08:57:32.6830227Z ------------------------------------------
2020-03-18T08:57:32.6830387Z 
---
2020-03-18T08:57:32.6831537Z - warning: unnecessary parentheses around `return` value
2020-03-18T08:57:32.6831832Z + warning: unnecessary parentheses around return value
2020-03-18T08:57:32.6832494Z 2   --> $DIR/path-lookahead.rs:8:10
2020-03-18T08:57:32.6832847Z 3    |
2020-03-18T08:57:32.6833084Z 4 LL |   return (<T as ToString>::to_string(&arg));
2020-03-18T08:57:32.6833386Z 
2020-03-18T08:57:32.6833607Z The actual stderr differed from the expected stderr.
2020-03-18T08:57:32.6834387Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/path-lookahead/path-lookahead.stderr
2020-03-18T08:57:32.6834387Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/path-lookahead/path-lookahead.stderr
2020-03-18T08:57:32.6835548Z To update references, rerun the tests and pass the `--bless` flag
2020-03-18T08:57:32.6836264Z To only update this specific test, also pass `--test-args path-lookahead.rs`
2020-03-18T08:57:32.6836663Z error: 1 errors occurred comparing output.
2020-03-18T08:57:32.6836899Z status: exit code: 0
2020-03-18T08:57:32.6836899Z status: exit code: 0
2020-03-18T08:57:32.6838541Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/path-lookahead.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/path-lookahead/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/path-lookahead/auxiliary"
2020-03-18T08:57:32.6840063Z ------------------------------------------
2020-03-18T08:57:32.6840224Z 
2020-03-18T08:57:32.6840561Z ------------------------------------------
2020-03-18T08:57:32.6840764Z stderr:
2020-03-18T08:57:32.6840764Z stderr:
2020-03-18T08:57:32.6841105Z ------------------------------------------
2020-03-18T08:57:32.6841370Z warning: unnecessary parentheses around return value
2020-03-18T08:57:32.6841841Z   --> /checkout/src/test/ui/path-lookahead.rs:8:10
2020-03-18T08:57:32.6842047Z    |
2020-03-18T08:57:32.6842462Z LL |   return (<T as ToString>::to_string(&arg)); //~WARN unnecessary parentheses around `return` value
2020-03-18T08:57:32.6843188Z    |
2020-03-18T08:57:32.6843474Z note: the lint level is defined here
2020-03-18T08:57:32.6843870Z   --> /checkout/src/test/ui/path-lookahead.rs:3:9
2020-03-18T08:57:32.6844050Z    |
---
2020-03-18T08:57:32.6849625Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-18T08:57:32.6850175Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-18T08:57:32.6850392Z 
2020-03-18T08:57:32.6850481Z 
2020-03-18T08:57:32.6854080Z 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-7/bin/FileCheck" "--nodejs" "/usr/bin/node" "--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" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-18T08:57:32.6856685Z 
2020-03-18T08:57:32.6856793Z 
2020-03-18T08:57:32.6857319Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-03-18T08:57:32.6857661Z Build completed unsuccessfully in 0:51:25
2020-03-18T08:57:32.6857661Z Build completed unsuccessfully in 0:51:25
2020-03-18T08:57:32.6857909Z == clock drift check ==
2020-03-18T08:57:32.6858141Z   local time: Wed Mar 18 08:57:32 UTC 2020
2020-03-18T08:57:32.9752376Z   network time: Wed, 18 Mar 2020 08:57:32 GMT
2020-03-18T08:57:32.9757379Z == end clock drift check ==
2020-03-18T08:57:33.5052839Z 
2020-03-18T08:57:33.5106458Z ##[error]Bash exited with code '1'.
2020-03-18T08:57:33.5126727Z ##[section]Finishing: Run build
2020-03-18T08:57:33.5166260Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T08:57:33.5170569Z Task         : Get sources
2020-03-18T08:57:33.5170813Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-18T08:57:33.5171049Z Version      : 1.0.0
2020-03-18T08:57:33.5171225Z Author       : Microsoft
2020-03-18T08:57:33.5171225Z Author       : Microsoft
2020-03-18T08:57:33.5171480Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-18T08:57:33.5171764Z ==============================================================================
2020-03-18T08:57:33.7941266Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-18T08:57:33.7995850Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T08:57:33.8080122Z Cleaning up task key
2020-03-18T08:57:33.8081143Z Start cleaning up orphan processes.
2020-03-18T08:57:33.8328554Z Terminate orphan process: pid (4833) (python)
2020-03-18T08:57:33.8352312Z ##[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 @rust-lang/infra. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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-03-18T09:12:13.3497724Z ========================== Starting Command Output ===========================
2020-03-18T09:12:13.3501054Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/ac871294-654e-4ba6-9b40-fb9cd3779ce4.sh
2020-03-18T09:12:13.3501484Z 
2020-03-18T09:12:13.3505876Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-18T09:12:13.3525356Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T09:12:13.3528682Z Task         : Get sources
2020-03-18T09:12:13.3529004Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-18T09:12:13.3529330Z Version      : 1.0.0
2020-03-18T09:12:13.3529539Z Author       : Microsoft
---
2020-03-18T09:12:14.5981603Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-18T09:12:14.5988592Z ##[command]git config gc.auto 0
2020-03-18T09:12:14.5993684Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-18T09:12:14.5997736Z ##[command]git config --get-all http.proxy
2020-03-18T09:12:14.6005779Z ##[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/70081/merge:refs/remotes/pull/70081/merge
---
2020-03-18T10:07:55.1634010Z .................................................................................................... 1700/9800
2020-03-18T10:07:59.2475086Z .................................................................................................... 1800/9800
2020-03-18T10:08:10.0116155Z ............................................................................i....................... 1900/9800
2020-03-18T10:08:15.9273873Z .................................................................................................... 2000/9800
2020-03-18T10:08:23.2437413Z ..................................................................iiiii............................. 2100/9800
2020-03-18T10:08:40.2727506Z .................................................................................................... 2300/9800
2020-03-18T10:08:42.3406779Z .................................................................................................... 2400/9800
2020-03-18T10:08:44.9802198Z .................................................................................................... 2500/9800
2020-03-18T10:09:04.1104209Z .................................................................................................... 2600/9800
---
2020-03-18T10:11:35.5370363Z ......................................i...............i............................................. 5000/9800
2020-03-18T10:11:44.0813750Z .................................................................................................... 5100/9800
2020-03-18T10:11:50.2263072Z .................................................................................i.................. 5200/9800
2020-03-18T10:11:55.4290609Z .................................................................................................... 5300/9800
2020-03-18T10:12:04.6933209Z ..............................................................ii.ii........i...i.................... 5400/9800
2020-03-18T10:12:12.6829720Z .i.................................................................................................. 5600/9800
2020-03-18T10:12:21.6374875Z .................................................................................................... 5700/9800
2020-03-18T10:12:27.4247343Z .........................................................i.......................................... 5800/9800
2020-03-18T10:12:33.7069081Z .................................................................................................... 5900/9800
2020-03-18T10:12:33.7069081Z .................................................................................................... 5900/9800
2020-03-18T10:12:40.9604317Z .................................................................................................... 6000/9800
2020-03-18T10:12:48.3730768Z ...................................................ii...i..ii...........i........................... 6100/9800
2020-03-18T10:13:07.4244399Z .................................................................................................... 6300/9800
2020-03-18T10:13:10.6951200Z .................................................................................................... 6400/9800
2020-03-18T10:13:10.6951200Z .................................................................................................... 6400/9800
2020-03-18T10:13:14.3259842Z .................................................................................i..ii.............. 6500/9800
2020-03-18T10:13:34.6501586Z .................................................................................................... 6700/9800
2020-03-18T10:13:42.8073768Z ...............................................................................i.................... 6800/9800
2020-03-18T10:13:44.7421996Z .................................................................................................... 6900/9800
2020-03-18T10:13:46.6139727Z .................................................................................................... 7000/9800
---
2020-03-18T10:15:22.6901722Z .................................................................................................... 7800/9800
2020-03-18T10:15:27.8585115Z .................................................................................................... 7900/9800
2020-03-18T10:15:33.4480954Z .................................................................i.................................. 8000/9800
2020-03-18T10:15:43.1117860Z .................................................................................................... 8100/9800
2020-03-18T10:15:48.3863341Z ..............iiiiiiiiii.i.......................................................................... 8200/9800
2020-03-18T10:16:01.1950865Z .................................................................................................... 8400/9800
2020-03-18T10:16:08.1459706Z .................................................................................................... 8500/9800
2020-03-18T10:16:20.6582023Z .................................................................................................... 8600/9800
2020-03-18T10:16:26.5659605Z .................................................................................................... 8700/9800
---
2020-03-18T10:18:11.9440580Z ---- [ui] ui/const-generics/unused_parens.rs stdout ----
2020-03-18T10:18:11.9440915Z 
2020-03-18T10:18:11.9441460Z error: test compilation failed although it shouldn't!
2020-03-18T10:18:11.9441863Z status: exit code: 1
2020-03-18T10:18:11.9443941Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/unused_parens.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/unused_parens" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/unused_parens/auxiliary"
2020-03-18T10:18:11.9445815Z ------------------------------------------
2020-03-18T10:18:11.9446111Z 
2020-03-18T10:18:11.9446595Z ------------------------------------------
2020-03-18T10:18:11.9446933Z stderr:
2020-03-18T10:18:11.9446933Z stderr:
2020-03-18T10:18:11.9447419Z ------------------------------------------
2020-03-18T10:18:11.9447883Z error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
2020-03-18T10:18:11.9448966Z    |
2020-03-18T10:18:11.9448966Z    |
2020-03-18T10:18:11.9449281Z LL | struct A<const N: usize = { 7 }> {
2020-03-18T10:18:11.9449712Z    |                         ^ expected one of 7 possible tokens
2020-03-18T10:18:11.9450315Z error: aborting due to previous error
2020-03-18T10:18:11.9450598Z 
2020-03-18T10:18:11.9450798Z 
2020-03-18T10:18:11.9451274Z ------------------------------------------
---
2020-03-18T10:18:11.9481814Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-18T10:18:11.9482255Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-18T10:18:11.9496226Z 
2020-03-18T10:18:11.9496416Z 
2020-03-18T10:18:11.9503089Z 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-7/bin/FileCheck" "--nodejs" "/usr/bin/node" "--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" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-18T10:18:11.9506193Z 
2020-03-18T10:18:11.9506548Z 
2020-03-18T10:18:11.9519102Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-03-18T10:18:11.9519664Z Build completed unsuccessfully in 1:00:54
2020-03-18T10:18:11.9519664Z Build completed unsuccessfully in 1:00:54
2020-03-18T10:18:12.7422509Z == clock drift check ==
2020-03-18T10:18:12.7422842Z   local time: Wed Mar 18 10:18:11 UTC 2020
2020-03-18T10:18:12.7423211Z   network time: Wed, 18 Mar 2020 10:18:12 GMT
2020-03-18T10:18:12.7423454Z == end clock drift check ==
2020-03-18T10:18:12.8059817Z 
2020-03-18T10:18:12.8133092Z ##[error]Bash exited with code '1'.
2020-03-18T10:18:12.8147477Z ##[section]Finishing: Run build
2020-03-18T10:18:12.8190447Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T10:18:12.8195191Z Task         : Get sources
2020-03-18T10:18:12.8195528Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-18T10:18:12.8195818Z Version      : 1.0.0
2020-03-18T10:18:12.8196036Z Author       : Microsoft
2020-03-18T10:18:12.8196036Z Author       : Microsoft
2020-03-18T10:18:12.8196378Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-18T10:18:12.8196750Z ==============================================================================
2020-03-18T10:18:13.1249586Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-18T10:18:13.1304260Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70081/merge to s
2020-03-18T10:18:13.1392211Z Cleaning up task key
2020-03-18T10:18:13.1393460Z Start cleaning up orphan processes.
2020-03-18T10:18:13.1683367Z Terminate orphan process: pid (4263) (python)
2020-03-18T10:18:13.1728727Z ##[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 @rust-lang/infra. (Feature Requests)

// - the block is not `unsafe`
// - the block contains exactly one expression (do not lint `{ expr; }`)
// - `followed_by_block` is true and the internal expr may contain a `{`
// - the block is not multiline
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the rationale for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because of the current formatting style:

match a {
    Some(v) => really_long_expr,
    // ...
}

gets formatted as

match a {
    Some(v) => {
        really_long_expr
    }
    // ...
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, please extend the comment with a brief mention of formatting style.

// - `followed_by_block` is true and the internal expr may contain a `{`
// - the block is not multiline
// - the block has no attribute and was not created inside a macro
// - if the block is a constant expression, the inner expr must be a literal.
Copy link
Contributor

Choose a reason for hiding this comment

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

and the rationale for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because of const generics, which sometimes require blocks, i.e. we don't want to lint

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash

trait IsZeroTrait<const IS_ZERO: bool>{}

impl IsZeroTrait<{0u8 == 0u8}> for () {} // the block is required,
// impl IsZeroTrait<0u8 == 0u8> // this does not compile

impl IsZeroTrait<true> for ((),) {}

fn main() {}

Copy link
Contributor

Choose a reason for hiding this comment

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

Please extend the comment to mention this, but also, having a path works fine in a block wrt. const generics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the comment to is a anon const.

I don't know how to check whether the anon const is an array length or a generic param.
But I also don't think that being too conservative is a big problem.

but also, having a path works fine in a block wrt. const generics.

Sadly not, see #70081 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added comments explaining the rationale.

@Centril Centril added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Mar 18, 2020
@varkor
Copy link
Member

varkor commented Mar 18, 2020

The following test currently causes unused_parens and I am not sure how to fix this.

Ah, this is due to #67075. It'd be nice to fix that, but I think it'd be involved.
Could you add a FIXME(const_generics): handle paths when #67075 is fixed. comment in the relevant section?

I don't know how to check whether the anon const is an array length

I think you might be able to get away with special-casing check_tyfor TyKind::Array, and checking if the AnonConst in the second field has curly brackets. I think array lengths are the only AnonConsts that need to be special-cased in this way.

@lcnr lcnr force-pushed the issue68387 branch 2 times, most recently from 1fc95f0 to a9f3ca1 Compare March 18, 2020 18:07
@nikomatsakis
Copy link
Contributor

One thought:

If the primary motivating example is Foo<{C}>, this normalization could also be done (likely with less complexity) in rustfmt, right? That might be a nicer UI.

@lcnr
Copy link
Contributor Author

lcnr commented Mar 31, 2020

There were 2 unused braces in sys::windows...

I hope that's it now. sry @Centril

@varkor
Copy link
Member

varkor commented Mar 31, 2020

@lcnr: could you merge the little fixup commits at the same time? Thanks :)

@lcnr lcnr force-pushed the issue68387 branch 3 times, most recently from e774ffc to 9b35a33 Compare March 31, 2020 16:59
@lcnr
Copy link
Contributor Author

lcnr commented Mar 31, 2020

Did some cleanup. Changing the wording from head to scrutinee is still split as this also affects unused_parens.

@varkor
Copy link
Member

varkor commented Mar 31, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 31, 2020

📌 Commit bab327c has been approved by varkor

@Centril
Copy link
Contributor

Centril commented Mar 31, 2020

@bors rollup-

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 31, 2020
add `unused_braces` lint

Add the lint `unused_braces` which is warn by default.

`unused_parens` is also extended and now checks anon consts.

closes rust-lang#68387

r? @varkor
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2020
Rollup of 6 pull requests

Successful merges:

 - rust-lang#68770 (BTreeMap/BTreeSet: implement drain_filter )
 - rust-lang#70081 (add `unused_braces` lint)
 - rust-lang#70556 (parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.)
 - rust-lang#70605 (Add missing -lmsvcrt on mingw after -lpthread)
 - rust-lang#70630 (Update books.)
 - rust-lang#70632 (expand vec![] to Vec::new())

Failed merges:

r? @ghost
@bors bors merged commit 8993358 into rust-lang:master Apr 1, 2020
@lcnr lcnr deleted the issue68387 branch April 1, 2020 07:43
flip1995 added a commit to flip1995/rust-clippy that referenced this pull request Apr 1, 2020
@shepmaster
Copy link
Member

shepmaster commented Apr 4, 2020

cc #70717

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jun 8, 2020
Pkgsrc changes:
 * Remove a couple diffs which are now integrated upstream.
 * Adjust cargo checksums after upstream upgrades.
 * Belatedly bump the curl dependency
 * Unset DESTDIR during the build phase, to work around a mysterious
   build bug deep in the bowels of llvm.
 * Bump nearly all bootstraps to 1.43.1.

Upstream changes:

Version 1.44.0 (2020-06-04)
==========================

Language
--------
- [You can now use `async/.await` with `#[no_std]` enabled.][69033]
- [Added the `unused_braces` lint.][70081]

**Syntax-only changes**

- [Expansion-driven outline module parsing][69838]
```rust
#[cfg(FALSE)]
mod foo {
    mod bar {
        mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
    }
}
```

These are still rejected semantically, so you will likely receive an error but
these changes can be seen and parsed by macros and conditional compilation.

Compiler
--------
- [Rustc now respects the `-C codegen-units` flag in incremental mode.][70156]
  Additionally when in incremental mode rustc defaults to 256 codegen units.
- [Refactored `catch_unwind`, to have zero-cost unless unwinding is enabled and
  a panic is thrown.][67502]
- [Added tier 3\* support for the `aarch64-unknown-none` and
  `aarch64-unknown-none-softfloat` targets.][68334]
- [Added tier 3 support for `arm64-apple-tvos` and
  `x86_64-apple-tvos` targets.][68191]

Libraries
---------
- [Special cased `vec![]` to map directly to `Vec::new()`.][70632] This allows
  `vec![]` to be able to be used in `const` contexts.
- [`convert::Infallible` now implements `Hash`.][70281]
- [`OsString` now implements `DerefMut` and `IndexMut` returning
  a `&mut OsStr`.][70048]
- [Unicode 13 is now supported.][69929]
- [`String` now implements `From<&mut str>`.][69661]
- [`IoSlice` now implements `Copy`.][69403]
- [`Vec<T>` now implements `From<[T; N]>`.][68692] Where `N` is less than 32.
- [`proc_macro::LexError` now implements `fmt::Display` and `Error`.][68899]
- [`from_le_bytes`, `to_le_bytes`, `from_be_bytes`, `to_be_bytes`,
  `from_ne_bytes`, and `to_ne_bytes` methods are now `const` for all
  integer types.][69373]

Stabilized APIs
---------------
- [`PathBuf::with_capacity`]
- [`PathBuf::capacity`]
- [`PathBuf::clear`]
- [`PathBuf::reserve`]
- [`PathBuf::reserve_exact`]
- [`PathBuf::shrink_to_fit`]
- [`f32::to_int_unchecked`]
- [`f64::to_int_unchecked`]
- [`Layout::align_to`]
- [`Layout::pad_to_align`]
- [`Layout::array`]
- [`Layout::extend`]

Cargo
-----
- [Added the `cargo tree` command which will print a tree graph of
  your dependencies.][cargo/8062] E.g.
  ```
    mdbook v0.3.2 (/Users/src/rust/mdbook)
  +-- ammonia v3.0.0
  |   +-- html5ever v0.24.0
  |   |   +-- log v0.4.8
  |   |   |   +-- cfg-if v0.1.9
  |   |   +-- mac v0.1.1
  |   |   +-- markup5ever v0.9.0
  |   |       +-- log v0.4.8 (*)
  |   |       +-- phf v0.7.24
  |   |       |   +-- phf_shared v0.7.24
  |   |       |       +-- siphasher v0.2.3
  |   |       |       +-- unicase v1.4.2
  |   |       |           [build-dependencies]
  |   |       |           +-- version_check v0.1.5
  ...
  ```
  You can also display dependencies on multiple versions of the same crate with
  `cargo tree -d` (short for `cargo tree --duplicates`).

Misc
----
- [Rustdoc now allows you to specify `--crate-version` to have rustdoc include
  the version in the sidebar.][69494]

Compatibility Notes
-------------------
- [Rustc now correctly generates static libraries on Windows GNU targets with
  the `.a` extension, rather than the previous `.lib`.][70937]
- [Removed the `-C no_integrated_as` flag from rustc.][70345]
- [The `file_name` property in JSON output of macro errors now points the actual
  source file rather than the previous format of `<NAME macros>`.][70969]
  **Note:** this may not point a file that actually exists on the user's system.
- [The minimum required external LLVM version has been bumped to LLVM 8.][71147]
- [`mem::{zeroed, uninitialised}` will now panic when used with types that do
  not allow zero initialization such as `NonZeroU8`.][66059] This was
  previously a warning.
- [In 1.45.0 (the next release) converting a `f64` to `u32` using the `as`
  operator has been defined as a saturating operation.][71269] This was
  previously undefined behaviour, you can use the `{f64, f32}::to_int_unchecked`
  methods to continue using the current behaviour which may desirable in rare
  performance sensitive situations.

Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.

- [dep_graph Avoid allocating a set on when the number reads are small.][69778]
- [Replace big JS dict with JSON parsing.][71250]

[69373]: rust-lang/rust#69373
[66059]: rust-lang/rust#66059
[68191]: rust-lang/rust#68191
[68899]: rust-lang/rust#68899
[71147]: rust-lang/rust#71147
[71250]: rust-lang/rust#71250
[70937]: rust-lang/rust#70937
[70969]: rust-lang/rust#70969
[70632]: rust-lang/rust#70632
[70281]: rust-lang/rust#70281
[70345]: rust-lang/rust#70345
[70048]: rust-lang/rust#70048
[70081]: rust-lang/rust#70081
[70156]: rust-lang/rust#70156
[71269]: rust-lang/rust#71269
[69838]: rust-lang/rust#69838
[69929]: rust-lang/rust#69929
[69661]: rust-lang/rust#69661
[69778]: rust-lang/rust#69778
[69494]: rust-lang/rust#69494
[69403]: rust-lang/rust#69403
[69033]: rust-lang/rust#69033
[68692]: rust-lang/rust#68692
[68334]: rust-lang/rust#68334
[67502]: rust-lang/rust#67502
[cargo/8062]: rust-lang/cargo#8062
[`PathBuf::with_capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.with_capacity
[`PathBuf::capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.capacity
[`PathBuf::clear`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.clear
[`PathBuf::reserve`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve
[`PathBuf::reserve_exact`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve_exact
[`PathBuf::shrink_to_fit`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.shrink_to_fit
[`f32::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked
[`f64::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_int_unchecked
[`Layout::align_to`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.align_to
[`Layout::pad_to_align`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.pad_to_align
[`Layout::array`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.array
[`Layout::extend`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.extend
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jun 9, 2020
Version 1.44.0 (2020-06-04)
==========================

Language
--------
- [You can now use `async/.await` with `#[no_std]` enabled.][69033]
- [Added the `unused_braces` lint.][70081]

**Syntax-only changes**

- [Expansion-driven outline module parsing][69838]
```rust
#[cfg(FALSE)]
mod foo {
    mod bar {
        mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
    }
}
```

These are still rejected semantically, so you will likely receive an error but
these changes can be seen and parsed by macros and conditional compilation.

Compiler
--------
- [Rustc now respects the `-C codegen-units` flag in incremental mode.][70156]
  Additionally when in incremental mode rustc defaults to 256 codegen units.
- [Refactored `catch_unwind` to have zero-cost, unless unwinding is enabled and
  a panic is thrown.][67502]
- [Added tier 3\* support for the `aarch64-unknown-none` and
  `aarch64-unknown-none-softfloat` targets.][68334]
- [Added tier 3 support for `arm64-apple-tvos` and
  `x86_64-apple-tvos` targets.][68191]


Libraries
---------
- [Special cased `vec![]` to map directly to `Vec::new()`.][70632] This allows
  `vec![]` to be able to be used in `const` contexts.
- [`convert::Infallible` now implements `Hash`.][70281]
- [`OsString` now implements `DerefMut` and `IndexMut` returning
  a `&mut OsStr`.][70048]
- [Unicode 13 is now supported.][69929]
- [`String` now implements `From<&mut str>`.][69661]
- [`IoSlice` now implements `Copy`.][69403]
- [`Vec<T>` now implements `From<[T; N]>`.][68692] Where `N` is at most 32.
- [`proc_macro::LexError` now implements `fmt::Display` and `Error`.][68899]
- [`from_le_bytes`, `to_le_bytes`, `from_be_bytes`, `to_be_bytes`,
  `from_ne_bytes`, and `to_ne_bytes` methods are now `const` for all
  integer types.][69373]

Stabilized APIs
---------------
- [`PathBuf::with_capacity`]
- [`PathBuf::capacity`]
- [`PathBuf::clear`]
- [`PathBuf::reserve`]
- [`PathBuf::reserve_exact`]
- [`PathBuf::shrink_to_fit`]
- [`f32::to_int_unchecked`]
- [`f64::to_int_unchecked`]
- [`Layout::align_to`]
- [`Layout::pad_to_align`]
- [`Layout::array`]
- [`Layout::extend`]

Cargo
-----
- [Added the `cargo tree` command which will print a tree graph of
  your dependencies.][cargo/8062] E.g.
  ```
    mdbook v0.3.2 (/Users/src/rust/mdbook)
  ├── ammonia v3.0.0
  │   ├── html5ever v0.24.0
  │   │   ├── log v0.4.8
  │   │   │   └── cfg-if v0.1.9
  │   │   ├── mac v0.1.1
  │   │   └── markup5ever v0.9.0
  │   │       ├── log v0.4.8 (*)
  │   │       ├── phf v0.7.24
  │   │       │   └── phf_shared v0.7.24
  │   │       │       ├── siphasher v0.2.3
  │   │       │       └── unicase v1.4.2
  │   │       │           [build-dependencies]
  │   │       │           └── version_check v0.1.5
  ...
  ```
  You can also display dependencies on multiple versions of the same crate with
  `cargo tree -d` (short for `cargo tree --duplicates`).

Misc
----
- [Rustdoc now allows you to specify `--crate-version` to have rustdoc include
  the version in the sidebar.][69494]

Compatibility Notes
-------------------
- [Rustc now correctly generates static libraries on Windows GNU targets with
  the `.a` extension, rather than the previous `.lib`.][70937]
- [Removed the `-C no_integrated_as` flag from rustc.][70345]
- [The `file_name` property in JSON output of macro errors now points the actual
  source file rather than the previous format of `<NAME macros>`.][70969]
  **Note:** this may not point to a file that actually exists on the user's system.
- [The minimum required external LLVM version has been bumped to LLVM 8.][71147]
- [`mem::{zeroed, uninitialised}` will now panic when used with types that do
  not allow zero initialization such as `NonZeroU8`.][66059] This was
  previously a warning.
- [In 1.45.0 (the next release) converting a `f64` to `u32` using the `as`
  operator has been defined as a saturating operation.][71269] This was previously
  undefined behaviour, but you can use the `{f64, f32}::to_int_unchecked` methods to
  continue using the current behaviour, which may be desirable in rare performance
  sensitive situations.

Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.

- [dep_graph Avoid allocating a set on when the number reads are small.][69778]
- [Replace big JS dict with JSON parsing.][71250]

[69373]: rust-lang/rust#69373
[66059]: rust-lang/rust#66059
[68191]: rust-lang/rust#68191
[68899]: rust-lang/rust#68899
[71147]: rust-lang/rust#71147
[71250]: rust-lang/rust#71250
[70937]: rust-lang/rust#70937
[70969]: rust-lang/rust#70969
[70632]: rust-lang/rust#70632
[70281]: rust-lang/rust#70281
[70345]: rust-lang/rust#70345
[70048]: rust-lang/rust#70048
[70081]: rust-lang/rust#70081
[70156]: rust-lang/rust#70156
[71269]: rust-lang/rust#71269
[69838]: rust-lang/rust#69838
[69929]: rust-lang/rust#69929
[69661]: rust-lang/rust#69661
[69778]: rust-lang/rust#69778
[69494]: rust-lang/rust#69494
[69403]: rust-lang/rust#69403
[69033]: rust-lang/rust#69033
[68692]: rust-lang/rust#68692
[68334]: rust-lang/rust#68334
[67502]: rust-lang/rust#67502
[cargo/8062]: rust-lang/cargo#8062
[`PathBuf::with_capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.with_capacity
[`PathBuf::capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.capacity
[`PathBuf::clear`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.clear
[`PathBuf::reserve`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve
[`PathBuf::reserve_exact`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve_exact
[`PathBuf::shrink_to_fit`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.shrink_to_fit
[`f32::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked
[`f64::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_int_unchecked
[`Layout::align_to`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.align_to
[`Layout::pad_to_align`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.pad_to_align
[`Layout::array`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.array
[`Layout::extend`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.extend
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jul 6, 2020
Pkgsrc changes:
 * Remove the clutter caused by the cross-compile setup from Makefile
   (Now consigned to my own private cross.mk file.)
 * Remove a couple of patches which are now integrated upstream.
 * Minor adjustments to a couple of other patches.
 * Adjust cargo checksums after upstream upgrades.
 * Belatedly bump the curl dependency
 * If doing a "dist" build, unset DESTDIR during the build phase,
   to work around a mysterious build bug deep in the bowels of llvm,
   causing llvm tools to be installed to a directory unexpecetd by
   the rest of the rust build, ref.
   rust-lang/rust#73132
   A "dist" build is not expected to be followed by an "install".
 * Bump nearly all bootstraps to 1.43.1; NetBSD earmv7hf bootstrap
   bumped to 1.44.0, as that one now finally builds and works.

Upstream changes:

Version 1.44.0 (2020-06-04)
==========================

Language
--------
- [You can now use `async/.await` with `#[no_std]` enabled.][69033]
- [Added the `unused_braces` lint.][70081]

**Syntax-only changes**

- [Expansion-driven outline module parsing][69838]
```rust
#[cfg(FALSE)]
mod foo {
    mod bar {
        mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
    }
}
```

These are still rejected semantically, so you will likely receive an error but
these changes can be seen and parsed by macros and conditional compilation.

Compiler
--------
- [Rustc now respects the `-C codegen-units` flag in incremental mode.][70156]
  Additionally when in incremental mode rustc defaults to 256 codegen units.
- [Refactored `catch_unwind`, to have zero-cost unless unwinding is enabled and
  a panic is thrown.][67502]
- [Added tier 3\* support for the `aarch64-unknown-none` and
  `aarch64-unknown-none-softfloat` targets.][68334]
- [Added tier 3 support for `arm64-apple-tvos` and
  `x86_64-apple-tvos` targets.][68191]

Libraries
---------
- [Special cased `vec![]` to map directly to `Vec::new()`.][70632] This allows
  `vec![]` to be able to be used in `const` contexts.
- [`convert::Infallible` now implements `Hash`.][70281]
- [`OsString` now implements `DerefMut` and `IndexMut` returning
  a `&mut OsStr`.][70048]
- [Unicode 13 is now supported.][69929]
- [`String` now implements `From<&mut str>`.][69661]
- [`IoSlice` now implements `Copy`.][69403]
- [`Vec<T>` now implements `From<[T; N]>`.][68692] Where `N` is less than 32.
- [`proc_macro::LexError` now implements `fmt::Display` and `Error`.][68899]
- [`from_le_bytes`, `to_le_bytes`, `from_be_bytes`, `to_be_bytes`,
  `from_ne_bytes`, and `to_ne_bytes` methods are now `const` for all
  integer types.][69373]

Stabilized APIs
---------------
- [`PathBuf::with_capacity`]
- [`PathBuf::capacity`]
- [`PathBuf::clear`]
- [`PathBuf::reserve`]
- [`PathBuf::reserve_exact`]
- [`PathBuf::shrink_to_fit`]
- [`f32::to_int_unchecked`]
- [`f64::to_int_unchecked`]
- [`Layout::align_to`]
- [`Layout::pad_to_align`]
- [`Layout::array`]
- [`Layout::extend`]

Cargo
-----
- [Added the `cargo tree` command which will print a tree graph of
  your dependencies.][cargo/8062] E.g.
  ```
    mdbook v0.3.2 (/Users/src/rust/mdbook)
  +-- ammonia v3.0.0
  |   +-- html5ever v0.24.0
  |   |   +-- log v0.4.8
  |   |   |   +-- cfg-if v0.1.9
  |   |   +-- mac v0.1.1
  |   |   +-- markup5ever v0.9.0
  |   |       +-- log v0.4.8 (*)
  |   |       +-- phf v0.7.24
  |   |       |   +-- phf_shared v0.7.24
  |   |       |       +-- siphasher v0.2.3
  |   |       |       +-- unicase v1.4.2
  |   |       |           [build-dependencies]
  |   |       |           +-- version_check v0.1.5
  ...
  ```
  You can also display dependencies on multiple versions of the same crate with
  `cargo tree -d` (short for `cargo tree --duplicates`).

Misc
----
- [Rustdoc now allows you to specify `--crate-version` to have rustdoc include
  the version in the sidebar.][69494]

Compatibility Notes
-------------------
- [Rustc now correctly generates static libraries on Windows GNU targets with
  the `.a` extension, rather than the previous `.lib`.][70937]
- [Removed the `-C no_integrated_as` flag from rustc.][70345]
- [The `file_name` property in JSON output of macro errors now points the actual
  source file rather than the previous format of `<NAME macros>`.][70969]
  **Note:** this may not point a file that actually exists on the user's system.
- [The minimum required external LLVM version has been bumped to LLVM 8.][71147]
- [`mem::{zeroed, uninitialised}` will now panic when used with types that do
  not allow zero initialization such as `NonZeroU8`.][66059] This was
  previously a warning.
- [In 1.45.0 (the next release) converting a `f64` to `u32` using the `as`
  operator has been defined as a saturating operation.][71269] This was
  previously undefined behaviour, you can use the `{f64, f32}::to_int_unchecked`
  methods to continue using the current behaviour which may desirable in rare
  performance sensitive situations.

Internal Only
-------------
These changes provide no direct user facing benefits, but represent significant
improvements to the internals and overall performance of rustc and
related tools.

- [dep_graph Avoid allocating a set on when the number reads are small.][69778]
- [Replace big JS dict with JSON parsing.][71250]

[69373]: rust-lang/rust#69373
[66059]: rust-lang/rust#66059
[68191]: rust-lang/rust#68191
[68899]: rust-lang/rust#68899
[71147]: rust-lang/rust#71147
[71250]: rust-lang/rust#71250
[70937]: rust-lang/rust#70937
[70969]: rust-lang/rust#70969
[70632]: rust-lang/rust#70632
[70281]: rust-lang/rust#70281
[70345]: rust-lang/rust#70345
[70048]: rust-lang/rust#70048
[70081]: rust-lang/rust#70081
[70156]: rust-lang/rust#70156
[71269]: rust-lang/rust#71269
[69838]: rust-lang/rust#69838
[69929]: rust-lang/rust#69929
[69661]: rust-lang/rust#69661
[69778]: rust-lang/rust#69778
[69494]: rust-lang/rust#69494
[69403]: rust-lang/rust#69403
[69033]: rust-lang/rust#69033
[68692]: rust-lang/rust#68692
[68334]: rust-lang/rust#68334
[67502]: rust-lang/rust#67502
[cargo/8062]: rust-lang/cargo#8062
[`PathBuf::with_capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.with_capacity
[`PathBuf::capacity`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.capacity
[`PathBuf::clear`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.clear
[`PathBuf::reserve`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve
[`PathBuf::reserve_exact`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.reserve_exact
[`PathBuf::shrink_to_fit`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.shrink_to_fit
[`f32::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked
[`f64::to_int_unchecked`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_int_unchecked
[`Layout::align_to`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.align_to
[`Layout::pad_to_align`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.pad_to_align
[`Layout::array`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.array
[`Layout::extend`]: https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.extend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-const_generics `#![feature(const_generics)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider extending unused_parens to {}, particularly in const generics
9 participants