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

Suggest calling async closure when needed #66239

Merged
merged 3 commits into from Nov 19, 2019

Conversation

@estebank
Copy link
Contributor

estebank commented Nov 9, 2019

When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 9, 2019

r? @eddyb

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

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Nov 9, 2019

@rust-highfive rust-highfive assigned Centril and unassigned eddyb Nov 9, 2019
src/librustc/traits/error_reporting.rs Show resolved Hide resolved
src/librustc/traits/error_reporting.rs Outdated Show resolved Hide resolved
src/librustc/traits/error_reporting.rs Outdated Show resolved Hide resolved
src/librustc/traits/error_reporting.rs Outdated Show resolved Hide resolved
@Centril

This comment has been minimized.

Copy link
Member

Centril commented Nov 14, 2019

@estebank 👋 :)

estebank added 2 commits Nov 9, 2019
When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.
@estebank estebank force-pushed the estebank:suggest-async-closure-call branch from 1a0703b to d7efa5b Nov 17, 2019
Copy link
Member

Centril left a comment

nits

src/librustc/traits/error_reporting.rs Outdated Show resolved Hide resolved
src/librustc/traits/error_reporting.rs Outdated Show resolved Hide resolved
Copy link
Member

Centril left a comment

r=me with nits fixed

src/librustc/traits/error_reporting.rs Outdated Show resolved Hide resolved
src/librustc/traits/error_reporting.rs Outdated Show resolved Hide resolved
@estebank estebank force-pushed the estebank:suggest-async-closure-call branch from fa057fd to fcf26aa Nov 18, 2019
@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Nov 18, 2019

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

Click to expand the log.
2019-11-18T17:58:12.7349725Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-18T17:58:12.7634613Z ##[command]git config gc.auto 0
2019-11-18T17:58:12.7669908Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-18T17:58:12.7750878Z ##[command]git config --get-all http.proxy
2019-11-18T17:58:12.7956517Z ##[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/66239/merge:refs/remotes/pull/66239/merge
---
2019-11-18T18:07:44.0861279Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-11-18T18:07:54.1764574Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-11-18T18:07:55.8408181Z    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
2019-11-18T18:08:16.7974389Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2019-11-18T18:08:32.0861290Z error: expected one of `.`, `?`, `{`, or an operator, found `;`
2019-11-18T18:08:32.0861926Z      |
2019-11-18T18:08:32.0861926Z      |
2019-11-18T18:08:32.0862217Z 1286 |         let hir_id = match hir.as_local_hir_id(def_id)?;
2019-11-18T18:08:32.0862638Z      |                      -----                             ^ expected one of `.`, `?`, `{`, or an operator here
2019-11-18T18:08:32.0863352Z      |                      while parsing this match expression
2019-11-18T18:08:32.0863616Z      |                      help: try removing this `match`
2019-11-18T18:08:32.0863742Z 
2019-11-18T18:08:55.6809783Z error: aborting due to previous error
---
2019-11-18T18:08:58.2837941Z   local time: Mon Nov 18 18:08:58 UTC 2019
2019-11-18T18:08:58.5678289Z   network time: Mon, 18 Nov 2019 18:08:58 GMT
2019-11-18T18:08:58.5682653Z == end clock drift check ==
2019-11-18T18:08:59.6844864Z 
2019-11-18T18:08:59.6949833Z ##[error]Bash exited with code '1'.
2019-11-18T18:08:59.6979766Z ##[section]Starting: Checkout
2019-11-18T18:08:59.6981509Z ==============================================================================
2019-11-18T18:08:59.6981562Z Task         : Get sources
2019-11-18T18:08:59.6981607Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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

@estebank estebank force-pushed the estebank:suggest-async-closure-call branch from fcf26aa to 614da98 Nov 18, 2019
@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Nov 18, 2019

@bors r=Centril

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 18, 2019

📌 Commit 614da98 has been approved by Centril

JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 19, 2019
…, r=Centril

Suggest calling async closure when needed

When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix rust-lang#65923.
bors added a commit that referenced this pull request Nov 19, 2019
Rollup of 13 pull requests

Successful merges:

 - #66090 (Misc CI improvements)
 - #66239 (Suggest calling async closure when needed)
 - #66430 ([doc] Fix the source code highlighting on source comments)
 - #66431 (Fix 'type annotations needed' error with opaque types)
 - #66461 (Add explanation message for E0641)
 - #66468 (Cleanup Miri SIMD intrinsics)
 - #66478 (rustc_plugin: Remove the compatibility shim)
 - #66493 (Add JohnTitor to rustc-guide toolstate notification list)
 - #66511 (std::error::Chain: remove Copy)
 - #66512 (Add unix::process::CommandExt::arg0)
 - #66520 (Disable gdb pretty printer global section on wasm targets)
 - #66529 (resolve: Give derive helpers highest priority during resolution)
 - #66536 (Move the definition of `QueryResult` into `plumbing.rs`.)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 19, 2019

⌛️ Testing commit 614da98 with merge 10a0e4c...

bors added a commit that referenced this pull request Nov 19, 2019
Suggest calling async closure when needed

When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.
Centril added a commit to Centril/rust that referenced this pull request Nov 19, 2019
…, r=Centril

Suggest calling async closure when needed

When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix rust-lang#65923.
@Centril

This comment has been minimized.

Copy link
Member

Centril commented Nov 19, 2019

@bors retry rolled up.

bors added a commit that referenced this pull request Nov 19, 2019
Rollup of 11 pull requests

Successful merges:

 - #66090 (Misc CI improvements)
 - #66155 (Add long error explanation for E0594)
 - #66239 (Suggest calling async closure when needed)
 - #66430 ([doc] Fix the source code highlighting on source comments)
 - #66431 (Fix 'type annotations needed' error with opaque types)
 - #66461 (Add explanation message for E0641)
 - #66493 (Add JohnTitor to rustc-guide toolstate notification list)
 - #66511 (std::error::Chain: remove Copy)
 - #66529 (resolve: Give derive helpers highest priority during resolution)
 - #66536 (Move the definition of `QueryResult` into `plumbing.rs`.)
 - #66538 (Remove compiler_builtins_lib feature from libstd)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 19, 2019

⌛️ Testing commit 614da98 with merge 9d6ff15...

@bors bors merged commit 614da98 into rust-lang:master Nov 19, 2019
4 of 5 checks passed
4 of 5 checks passed
homu Testing commit 614da98454984921142eb2059db7be953d2c855c with merge 9d6ff1553b7debbe5c99c102ce0978b6130592f8...
Details
pr #20191118.35 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@gilescope

This comment has been minimized.

Copy link
Contributor

gilescope commented on 0487f0c Nov 24, 2019

Thanks @estebank - that’s fantastic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.