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

Adds a clearer message for when the async keyword is missing from a f… #73672

Merged
merged 1 commit into from
Jun 28, 2020
Merged

Adds a clearer message for when the async keyword is missing from a f… #73672

merged 1 commit into from
Jun 28, 2020

Conversation

nellshamrell
Copy link
Contributor

@nellshamrell nellshamrell commented Jun 23, 2020

…unction

This is a somewhat simple fix for #66731.

Under the current version of Rust, if a user has a rust file that looks like this:

fn boo (){}

async fn foo() {
    boo().await;
}

fn main() {

}

And they attempt to run it, they will receive an error message that looks like this:

error: incorrect use of `await`                                                                                                        --> test.rs:4:14                                                                                                                       |                                                                                                                                   4 |     boo.await();                                                                                                                    |              ^^ help: `await` is not a method call, remove the parentheses                                                                                                                                                                                              error[E0277]: the trait bound `fn() {boo}: std::future::Future` is not satisfied                                                        --> test.rs:4:5                                                                                                                        |                                                                                                                                  4  |     boo.await();                                                                                                                    |     ^^^^^^^^^ the trait `std::future::Future` is not implemented for `fn() {boo}`                                                                                                                                                                                      error: aborting due to 2 previous errors                                                                                                                                                                                                                                    For more information about this error, try `rustc --explain E0277`.       

This is not very clear.

With the changes made in this PR, when a user compiles and runs that same rust code, they will receive an error message that looks like this:

error[E0277]: `()` is not a future.
 --> test.rs:4:5
  |
4 |     boo().await;
  |     ^^^^^^^^^^^ `()` is not a future
  |
  = help: the trait `std::future::Future` is not implemented for `()`
  = note: required by `std::future::Future::poll`

In the future, I think we should make this error message even clearer, perhaps through a solution like the one described in this comment. However, as that potentially involves a major change proposal, I would rather get this change in now and make the error message a little clearer while an MCP is drafted and discussed.

Signed-off-by: Nell Shamrell [email protected]

@rust-highfive
Copy link
Collaborator

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

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

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 23, 2020
@nellshamrell nellshamrell changed the title Adds a clearer message for when the async keyword is missing from a f… DRAFT: Adds a clearer message for when the async keyword is missing from a f… Jun 23, 2020
@nellshamrell nellshamrell marked this pull request as ready for review June 23, 2020 23:38
@nellshamrell nellshamrell changed the title DRAFT: Adds a clearer message for when the async keyword is missing from a f… Adds a clearer message for when the async keyword is missing from a f… Jun 23, 2020
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
##[section]Starting: Linux mingw-check
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 3'
Agent machine name: 'fv-az578'
Current agent version: '2.170.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200614.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200614.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.171.1)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/1d986edd-7e58-4656-a8fe-767e95f2d347.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/73672/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[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/73672/merge:refs/remotes/pull/73672/merge
---
 ---> a9ec21d337b3
Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
 ---> Using cache
 ---> 5ff2c13d8dba
Step 7/7 : ENV SCRIPT python3 ../x.py test src/tools/expand-yaml-anchors &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test src/tools/tidy &&            python3 ../x.py doc --stage 0 src/libstd &&            /scripts/validate-toolstate.sh
 ---> 6b931e755c7e
Successfully built 6b931e755c7e
Successfully tagged rust-ci:latest
Built container sha256:6b931e755c7ea1f69816640eb9df74fafd40a545d0e5aa8341d35009dabb0f3c
---
    Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
    Checking rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
    Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
    Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
    Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
    Checking chalk-engine v0.11.0
    Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
    Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
    Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
configure: build.cargo-native-static := True
configure: llvm.assertions      := True
configure: llvm.ccache          := sccache
configure: rust.channel         := nightly
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
Hugepagesize:       2048 kB
DirectMap4k:      143296 kB
DirectMap2M:     3002368 kB
DirectMap1G:     6291456 kB
+ python3 ../x.py test src/tools/expand-yaml-anchors
Ensuring the YAML anchors in the GitHub Actions config were expanded
Ensuring the YAML anchors in the GitHub Actions config were expanded
Building stage0 tool expand-yaml-anchors (x86_64-unknown-linux-gnu)
---
   Compiling linked-hash-map v0.5.2
   Compiling lazy_static v1.4.0
   Compiling yaml-rust v0.4.3
   Compiling quote v1.0.2
   Compiling thiserror-impl v1.0.5
   Compiling thiserror v1.0.5
   Compiling yaml-merge-keys v0.4.0
   Compiling expand-yaml-anchors v0.1.0 (/checkout/src/tools/expand-yaml-anchors)
Build completed successfully in 0:00:28
+ python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu
    Finished dev [unoptimized] target(s) in 0.19s
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> i686-pc-windows-gnu)
---
    Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
    Checking rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
    Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
    Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
    Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
    Checking chalk-engine v0.11.0
    Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
    Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
    Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/src/libcore/future/future.rs at line 27:
 #[must_use = "futures do nothing unless you `.await` or poll them"]
 #[stable(feature = "futures_api", since = "1.36.0")]
 #[lang = "future_trait"]
-#[rustc_on_unimplemented(
-    label = "`{Self}` is not a future",
-    message = "`{Self}` is not a future"
-)]
+#[rustc_on_unimplemented(label = "`{Self}` is not a future", message = "`{Self}` is not a future")]
 pub trait Future {
     /// The type of value produced on completion.
     #[stable(feature = "futures_api", since = "1.36.0")]
Build completed unsuccessfully in 0:00:45
Build completed unsuccessfully in 0:00:45
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/src/libcore/future/future.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
  local time: Tue Jun 23 23:58:23 UTC 2020
  network time: Tue, 23 Jun 2020 23:58:23 GMT
== end clock drift check ==


##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/73672/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/73672/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3642) (python)
##[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)

@nikomatsakis
Copy link
Contributor

r? @estebank

@rust-highfive rust-highfive assigned estebank and unassigned kennytm Jun 24, 2020
@estebank
Copy link
Contributor

@nellshamrell Can you run ./x.py fmt and add a test exercising this new output? Also, squash your commits as well.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 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.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 2'
Agent machine name: 'fv-az578'
Current agent version: '2.171.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200621.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200621.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.171.1)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/e99d61a8-4fe6-4791-9405-9e94ae0a0953.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/73672/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[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/73672/merge:refs/remotes/pull/73672/merge
---
 ---> 31fea614d2f3
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> 4195cadf126d
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 4e90f6b48f05
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> dfa0a356d899
---
Set({"src/librustc_parse_format"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_passes"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_plugin_impl"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_privacy"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_query_system"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_save_analysis"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_serialize"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_session"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_span"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
---
Set({"src/librustc_parse_format"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_passes"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_plugin_impl"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_privacy"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_query_system"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_save_analysis"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_serialize"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_session"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_span"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-engine v0.11.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.11.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-ir v0.11.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-engine v0.11.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling chalk-solve v0.11.0
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
---
......................i............................................................................. 1900/10398
.................................................................................................... 2000/10398
.................................................i..i............................................... 2100/10398
.................................................................................................... 2200/10398
.......................................iiiii........................................................ 2300/10398
.................................................................................................... 2500/10398
.................................................................................................... 2600/10398
.................................................................................................... 2700/10398
.................................................................................................... 2800/10398
---
.................................................................................................... 5300/10398
.................................................................................................... 5400/10398
..............................i..................................................................... 5500/10398
........................i........................................................................... 5600/10398
............................................ii.ii........i...i...................................... 5700/10398
.............i...................................................................................... 5900/10398
..........i......................................................................................... 6000/10398
..................................................................ii................................ 6100/10398
.....i.............................................................................................. 6200/10398
.....i.............................................................................................. 6200/10398
.................................................................................................... 6300/10398
.................................................................................................... 6400/10398
.............................ii...i..ii...........i................................................. 6500/10398
.................................................................................................... 6700/10398
.................................................................................................... 6800/10398
.................................................................................................... 6800/10398
................................................................i..ii............................... 6900/10398
.................................................................................................... 7100/10398
.................................................................................................... 7200/10398
....................i............................................................................... 7300/10398
.................................................................................................... 7400/10398
---
.................................................................................................... 8300/10398
.................................................................................................... 8400/10398
.....................................................................i.............................. 8500/10398
.................................................................................................... 8600/10398
........................iiiiii.iiiiii.i............................................................. 8700/10398
.................................................................................................... 8900/10398
.................................................................................................... 9000/10398
.................................................................................................... 9100/10398
................................................................................................F... 9200/10398
---
9    |
+    = help: the trait `std::future::Future` is not implemented for `()`
10    = note: the return type of a function must have a statically known size
11 
12 error[E0698]: type inside `async fn` body must be known in this context

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/async-error-span/async-error-span.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/async-error-span/async-error-span.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args async-await/async-error-span.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/async-await/async-error-span.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/async-await/async-error-span" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/async-error-span/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0277]: `()` is not a future
  --> /checkout/src/test/ui/async-await/async-error-span.rs:7:20
   |
LL | fn get_future() -> impl Future<Output = ()> {
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not a future
LL | //~^ ERROR the trait bound `(): std::future::Future` is not satisfied
   |     -------- this returned value is of type `!`
   |
   = help: the trait `std::future::Future` is not implemented for `()`
   = note: the return type of a function must have a statically known size
   = note: the return type of a function must have a statically known size

error[E0698]: type inside `async fn` body must be known in this context
   |
   |
LL |     let a; //~ ERROR type inside `async fn` body must be known in this context
   |
   |
note: the type is part of the `async fn` body because of this `await`
   |
   |
LL |     get_future().await;

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0698.
---

---- [ui] ui/async-await/issue-70594.rs stdout ----
diff of stderr:

27 LL |     [1; ().await];
29 
- error[E0277]: the trait bound `(): std::future::Future` is not satisfied
+ error[E0277]: `()` is not a future
31   --> $DIR/issue-70594.rs:4:9
31   --> $DIR/issue-70594.rs:4:9
32    |
33 LL |     [1; ().await];
-    |         ^^^^^^^^ the trait `std::future::Future` is not implemented for `()`
+    |         ^^^^^^^^ `()` is not a future
35    |
+    = help: the trait `std::future::Future` is not implemented for `()`
+    = help: the trait `std::future::Future` is not implemented for `()`
36    = note: required by `std::future::Future::poll`
37 
38 error: aborting due to 5 previous errors


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/issue-70594/issue-70594.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args async-await/issue-70594.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/async-await/issue-70594.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/async-await/issue-70594" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/issue-70594/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0728]: `await` is only allowed inside `async` functions and blocks
  --> /checkout/src/test/ui/async-await/issue-70594.rs:4:9
   |
LL | async fn fun() {
   |          --- this is not `async`
LL |     [1; ().await];
   |         ^^^^^^^^ only allowed inside `async` functions and blocks
error[E0744]: `.await` is not allowed in a `const`
  --> /checkout/src/test/ui/async-await/issue-70594.rs:4:9
   |
   |
LL |     [1; ().await];

error[E0658]: `loop` is not allowed in a `const`
  --> /checkout/src/test/ui/async-await/issue-70594.rs:4:9
   |
   |
LL |     [1; ().await];
   |
   |
   = note: see issue #52000 <***/issues/52000> for more information

error[E0744]: `.await` is not allowed in a `const`
  --> /checkout/src/test/ui/async-await/issue-70594.rs:4:9
   |
   |
LL |     [1; ().await];

error[E0277]: `()` is not a future
  --> /checkout/src/test/ui/async-await/issue-70594.rs:4:9
   |
   |
LL |     [1; ().await];
   |         ^^^^^^^^ `()` is not a future
   = help: the trait `std::future::Future` is not implemented for `()`
   = note: required by `std::future::Future::poll`

error: aborting due to 5 previous errors
---

---- [ui] ui/async-await/issues/issue-62009-1.rs stdout ----
diff of stderr:

27 LL |     (|_| 2333).await;
28    |     ^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
29 
- error[E0277]: the trait bound `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]: std::future::Future` is not satisfied
+ error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
32    |
32    |
33 LL |     (|_| 2333).await;
-    |     ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
-    |     ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
+    |     ^^^^^^^^^^^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future
+    = help: the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
36    = note: required by `std::future::Future::poll`
37 
38 error: aborting due to 4 previous errors
38 error: aborting due to 4 previous errors


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/issues/issue-62009-1/issue-62009-1.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args async-await/issues/issue-62009-1.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/async-await/issues/issue-62009-1.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/async-await/issues/issue-62009-1" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/issues/issue-62009-1/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0728]: `await` is only allowed inside `async` functions and blocks
  --> /checkout/src/test/ui/async-await/issues/issue-62009-1.rs:6:5
   |
LL | fn main() {
   |    ---- this is not `async`
LL |     async { let (); }.await;
   |     ^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
  --> /checkout/src/test/ui/async-await/issues/issue-62009-1.rs:8:5
   |
LL |   fn main() {
LL |   fn main() {
   |      ---- this is not `async`
...
LL | /     async {
LL | |     //~^ ERROR `await` is only allowed inside `async` functions and blocks
LL | |         let task1 = print_dur().await;
LL | |     }.await;
   | |___________^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
  --> /checkout/src/test/ui/async-await/issues/issue-62009-1.rs:12:5
   |
LL | fn main() {
LL | fn main() {
   |    ---- this is not `async`
...
LL |     (|_| 2333).await;
   |     ^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks

error[E0277]: `[closure@/checkout/src/test/ui/async-await/issues/issue-62009-1.rs:12:5: 12:15]` is not a future
   |
   |
LL |     (|_| 2333).await;
   |     ^^^^^^^^^^^^^^^^ `[closure@/checkout/src/test/ui/async-await/issues/issue-62009-1.rs:12:5: 12:15]` is not a future
   |
   = help: the trait `std::future::Future` is not implemented for `[closure@/checkout/src/test/ui/async-await/issues/issue-62009-1.rs:12:5: 12:15]`
   = note: required by `std::future::Future::poll`
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0277, E0728.
For more information about an error, try `rustc --explain E0277`.
---
- error[E0277]: the trait bound `u32: std::future::Future` is not satisfied
+ error[E0277]: `u32` is not a future
8   --> $DIR/issues-71798.rs:1:25
9    |
10 LL | fn test_ref(x: &u32) -> impl std::future::Future<Output = u32> + '_ {
-    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `u32`
+    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u32` is not a future
12 LL |     *x
13    |     -- this returned value is of type `u32`
---
17 error: aborting due to 2 previous errors


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues-71798/issues-71798.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args issues-71798.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues-71798.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/issues-71798" "-A" "unused" "-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-71798/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0425]: cannot find value `u` in this scope
  --> /checkout/src/test/ui/issues-71798.rs:6:24
   |
LL |     let _ = test_ref & u; //~ ERROR cannot find value `u` in this scope

error[E0277]: `u32` is not a future
  --> /checkout/src/test/ui/issues-71798.rs:1:25
   |
   |
LL | fn test_ref(x: &u32) -> impl std::future::Future<Output = u32> + '_ {
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u32` is not a future
LL |     *x //~^ ERROR the trait bound `u32: std::future::Future` is not satisfied
   |
   = help: the trait `std::future::Future` is not implemented for `u32`
   = note: the return type of a function must have a statically known size

---
15 LL |     bar(foo());

16    |            ^^
17 
- error[E0277]: the trait bound `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]: std::future::Future` is not satisfied
+ error[E0277]: `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
20    |
21 LL | fn bar(f: impl Future<Output=()>) {}

24 LL |     let async_closure = async || ();
24 LL |     let async_closure = async || ();
25    |                         -------- consider calling this closure
26 LL |     bar(async_closure);
-    |         ^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]`
+    |         ^^^^^^^^^^^^^ `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
+    = help: the trait `std::future::Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]`
29 help: use parentheses to call the closure
30    |
31 LL |     bar(async_closure());
31 LL |     bar(async_closure());


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.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/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called/auxiliary"
------------------------------------------

------------------------------------------
stderr:
---
   |
LL |     bar(foo()); //~ERROR E0277
   |            ^^

error[E0277]: `[closure@/checkout/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
   |
LL | fn bar(f: impl Future<Output=()>) {}
   |                ----------------- required by this bound in `bar`
...
...
LL |     let async_closure = async || ();
   |                         -------- consider calling this closure
LL |     bar(async_closure); //~ERROR E0277
   |         ^^^^^^^^^^^^^ `[closure@/checkout/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
   |
   = help: the trait `std::future::Future` is not implemented for `[closure@/checkout/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]`
   |
LL |     bar(async_closure()); //~ERROR E0277
   |                      ^^

---
thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:345:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


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-8/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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 1:02:44
Build completed unsuccessfully in 1:02:44
== clock drift check ==
  local time: Thu Jun 25 19:29:51 UTC 2020
  network time: Thu, 25 Jun 2020 19:29:52 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/73672/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/73672/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (4297) (python)
##[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)

@estebank
Copy link
Contributor

It seems like you need to call ./x.py test src/test/ui --stage 1 --bless so that the test output .stderr files get updated.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 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.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 4'
Agent machine name: 'fv-az578'
Current agent version: '2.171.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200621.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200621.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.171.1)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/8d7e22c3-f241-4366-8d7a-8a6891c57e0d.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/73672/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[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/73672/merge:refs/remotes/pull/73672/merge
---
 ---> 31fea614d2f3
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> 4195cadf126d
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 4e90f6b48f05
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> dfa0a356d899
---
Set({"src/librustc_parse_format"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_passes"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_plugin_impl"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_privacy"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_query_system"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_save_analysis"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_serialize"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_session"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_span"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
---
Set({"src/librustc_parse_format"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_passes"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_plugin_impl"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_privacy"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_query_system"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_save_analysis"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_serialize"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_session"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
Set({"src/librustc_span"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-engine v0.11.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.11.0
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-engine v0.11.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.11.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
......................i............................................................................. 1900/10398
.................................................................................................... 2000/10398
.................................................i..i............................................... 2100/10398
.................................................................................................... 2200/10398
.......................................iiiii........................................................ 2300/10398
.................................................................................................... 2500/10398
.................................................................................................... 2600/10398
.................................................................................................... 2700/10398
.................................................................................................... 2800/10398
---
.................................................................................................... 5300/10398
.................................................................................................... 5400/10398
..............................i..................................................................... 5500/10398
........................i........................................................................... 5600/10398
............................................ii.ii........i...i...................................... 5700/10398
.............i...................................................................................... 5900/10398
..........i......................................................................................... 6000/10398
..................................................................ii................................ 6100/10398
.....i.............................................................................................. 6200/10398
.....i.............................................................................................. 6200/10398
.................................................................................................... 6300/10398
.................................................................................................... 6400/10398
.............................ii...i..ii...........i................................................. 6500/10398
.................................................................................................... 6700/10398
.................................................................................................... 6800/10398
.................................................................................................... 6800/10398
................................................................i..ii............................... 6900/10398
.................................................................................................... 7100/10398
.................................................................................................... 7200/10398
....................i............................................................................... 7300/10398
.................................................................................................... 7400/10398
---
.................................................................................................... 8300/10398
.................................................................................................... 8400/10398
.....................................................................i.............................. 8500/10398
.................................................................................................... 8600/10398
.......................iiiiii..iiiiii.i............................................................. 8700/10398
.................................................................................................... 8900/10398
.................................................................................................... 9000/10398
.................................................................................................... 9100/10398
.................................................................................................... 9200/10398
---
failures:

---- [ui] ui/async-await/async-error-span.rs stdout ----

error: /checkout/src/test/ui/async-await/async-error-span.rs:7: unexpected error: '7:20: 7:44: `()` is not a future [E0277]'
error: /checkout/src/test/ui/async-await/async-error-span.rs:7: expected error not found: the trait bound `(): std::future::Future` is not satisfied

error: 1 unexpected errors found, 1 expected errors not found
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/async-await/async-error-span.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/async-await/async-error-span" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/async-error-span/auxiliary"
    Error {
        line_num: 7,
        kind: Some(
            Error,
            Error,
        ),
        msg: "7:20: 7:44: `()` is not a future [E0277]",
]

not found errors (from test file): [
    Error {
---
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- [ui] ui/async-await/issue-70594.rs stdout ----

error: /checkout/src/test/ui/async-await/issue-70594.rs:4: unexpected error: '4:9: 4:17: `()` is not a future [E0277]'
error: /checkout/src/test/ui/async-await/issue-70594.rs:4: expected error not found: the trait bound `(): std::future::Future` is not satisfied

error: 1 unexpected errors found, 1 expected errors not found
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/async-await/issue-70594.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/async-await/issue-70594" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/issue-70594/auxiliary"
    Error {
        line_num: 4,
        kind: Some(
            Error,
            Error,
        ),
        msg: "4:9: 4:17: `()` is not a future [E0277]",
]

not found errors (from test file): [
    Error {
---
thread '[ui] ui/async-await/issue-70594.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1482:13

---- [ui] ui/issues-71798.rs stdout ----

error: /checkout/src/test/ui/issues-71798.rs:1: unexpected error: '1:25: 1:68: `u32` is not a future [E0277]'

error: /checkout/src/test/ui/issues-71798.rs:1: expected error not found: the trait bound `u32: std::future::Future` is not satisfied
error: 1 unexpected errors found, 1 expected errors not found
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues-71798.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/issues-71798" "-A" "unused" "-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-71798/auxiliary"
    Error {
        line_num: 1,
        kind: Some(
            Error,
            Error,
        ),
        msg: "1:25: 1:68: `u32` is not a future [E0277]",
]

not found errors (from test file): [
    Error {
    Error {
        line_num: 1,
        kind: Some(
            Error,
        ),
        msg: "the trait bound `u32: std::future::Future` is not satisfied",
]

thread '[ui] ui/issues-71798.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1482:13

---

thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:345:22


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-8/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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 1:07:07
Build completed unsuccessfully in 1:07:07
== clock drift check ==
  local time: Thu Jun 25 21:49:06 UTC 2020
  network time: Thu, 25 Jun 2020 21:49:06 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/73672/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/73672/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3696) (python)
##[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)

@nellshamrell
Copy link
Contributor Author

@estebank I think this is good to go now!

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 26, 2020

📌 Commit 5e28eb5 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 26, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 27, 2020
Adds a clearer message for when the async keyword is missing from a f…

…unction

This is a somewhat simple fix for rust-lang#66731.

Under the current version of Rust, if a user has a rust file that looks like this:

```rust
fn boo (){}

async fn foo() {
    boo().await;
}

fn main() {

}
```

And they attempt to run it, they will receive an error message that looks like this:

```bash
error: incorrect use of `await`                                                                                                        --> test.rs:4:14                                                                                                                       |                                                                                                                                   4 |     boo.await();                                                                                                                    |              ^^ help: `await` is not a method call, remove the parentheses                                                                                                                                                                                              error[E0277]: the trait bound `fn() {boo}: std::future::Future` is not satisfied                                                        --> test.rs:4:5                                                                                                                        |                                                                                                                                  4  |     boo.await();                                                                                                                    |     ^^^^^^^^^ the trait `std::future::Future` is not implemented for `fn() {boo}`                                                                                                                                                                                      error: aborting due to 2 previous errors                                                                                                                                                                                                                                    For more information about this error, try `rustc --explain E0277`.
```

This is not very clear.

With the changes made in this PR, when a user compiles and runs that same rust code, they will receive an error message that looks like this:

```bash
error[E0277]: `()` is not a future.
 --> test.rs:4:5
  |
4 |     boo().await;
  |     ^^^^^^^^^^^ `()` is not a future
  |
  = help: the trait `std::future::Future` is not implemented for `()`
  = note: required by `std::future::Future::poll`
```

In the future, I think we should make this error message even clearer, perhaps through a solution like the one described in [this comment](rust-lang#66731 (comment)). However, as that potentially involves a major change proposal, I would rather get this change in now and make the error message a little clearer while an MCP is drafted and discussed.

Signed-off-by: Nell Shamrell <[email protected]>
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 28, 2020
Adds a clearer message for when the async keyword is missing from a f…

…unction

This is a somewhat simple fix for rust-lang#66731.

Under the current version of Rust, if a user has a rust file that looks like this:

```rust
fn boo (){}

async fn foo() {
    boo().await;
}

fn main() {

}
```

And they attempt to run it, they will receive an error message that looks like this:

```bash
error: incorrect use of `await`                                                                                                        --> test.rs:4:14                                                                                                                       |                                                                                                                                   4 |     boo.await();                                                                                                                    |              ^^ help: `await` is not a method call, remove the parentheses                                                                                                                                                                                              error[E0277]: the trait bound `fn() {boo}: std::future::Future` is not satisfied                                                        --> test.rs:4:5                                                                                                                        |                                                                                                                                  4  |     boo.await();                                                                                                                    |     ^^^^^^^^^ the trait `std::future::Future` is not implemented for `fn() {boo}`                                                                                                                                                                                      error: aborting due to 2 previous errors                                                                                                                                                                                                                                    For more information about this error, try `rustc --explain E0277`.
```

This is not very clear.

With the changes made in this PR, when a user compiles and runs that same rust code, they will receive an error message that looks like this:

```bash
error[E0277]: `()` is not a future.
 --> test.rs:4:5
  |
4 |     boo().await;
  |     ^^^^^^^^^^^ `()` is not a future
  |
  = help: the trait `std::future::Future` is not implemented for `()`
  = note: required by `std::future::Future::poll`
```

In the future, I think we should make this error message even clearer, perhaps through a solution like the one described in [this comment](rust-lang#66731 (comment)). However, as that potentially involves a major change proposal, I would rather get this change in now and make the error message a little clearer while an MCP is drafted and discussed.

Signed-off-by: Nell Shamrell <[email protected]>
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 28, 2020
Adds a clearer message for when the async keyword is missing from a f…

…unction

This is a somewhat simple fix for rust-lang#66731.

Under the current version of Rust, if a user has a rust file that looks like this:

```rust
fn boo (){}

async fn foo() {
    boo().await;
}

fn main() {

}
```

And they attempt to run it, they will receive an error message that looks like this:

```bash
error: incorrect use of `await`                                                                                                        --> test.rs:4:14                                                                                                                       |                                                                                                                                   4 |     boo.await();                                                                                                                    |              ^^ help: `await` is not a method call, remove the parentheses                                                                                                                                                                                              error[E0277]: the trait bound `fn() {boo}: std::future::Future` is not satisfied                                                        --> test.rs:4:5                                                                                                                        |                                                                                                                                  4  |     boo.await();                                                                                                                    |     ^^^^^^^^^ the trait `std::future::Future` is not implemented for `fn() {boo}`                                                                                                                                                                                      error: aborting due to 2 previous errors                                                                                                                                                                                                                                    For more information about this error, try `rustc --explain E0277`.
```

This is not very clear.

With the changes made in this PR, when a user compiles and runs that same rust code, they will receive an error message that looks like this:

```bash
error[E0277]: `()` is not a future.
 --> test.rs:4:5
  |
4 |     boo().await;
  |     ^^^^^^^^^^^ `()` is not a future
  |
  = help: the trait `std::future::Future` is not implemented for `()`
  = note: required by `std::future::Future::poll`
```

In the future, I think we should make this error message even clearer, perhaps through a solution like the one described in [this comment](rust-lang#66731 (comment)). However, as that potentially involves a major change proposal, I would rather get this change in now and make the error message a little clearer while an MCP is drafted and discussed.

Signed-off-by: Nell Shamrell <[email protected]>
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 28, 2020
…arth

Rollup of 10 pull requests

Successful merges:

 - rust-lang#72796 (MIR sanity check: validate types on assignment)
 - rust-lang#73243 (Add documentation to point to `File::open` or `OpenOptions::open` instead of `is_file` to check read/write possibility)
 - rust-lang#73525 (Prepare for LLVM 11)
 - rust-lang#73672 (Adds a clearer message for when the async keyword is missing from a f…)
 - rust-lang#73708 (Explain move errors that occur due to method calls involving `self` (take two))
 - rust-lang#73758 (improper_ctypes: fix remaining `Reveal:All`)
 - rust-lang#73763 (errors: use `-Z terminal-width` in JSON emitter)
 - rust-lang#73796 (replace more `DefId`s with `LocalDefId`)
 - rust-lang#73797 (fix typo in self-profile.md)
 - rust-lang#73809 (Add links to fs::DirEntry::metadata)

Failed merges:

r? @ghost
@bors bors merged commit d227a82 into rust-lang:master Jun 28, 2020
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants