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

Check that main/start is not async #71174

Merged
merged 1 commit into from
Apr 21, 2020
Merged

Check that main/start is not async #71174

merged 1 commit into from
Apr 21, 2020

Conversation

Nokel81
Copy link
Contributor

@Nokel81 Nokel81 commented Apr 15, 2020

  • Add new error code E0752
  • Add span to hir::IsAsync::Yes
  • Emit an error if main or the start function is marked as async
  • Add two regression tests

This PR fixes #68523.

@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 15, 2020
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
2020-04-15T18:18:54.2651901Z ========================== Starting Command Output ===========================
2020-04-15T18:18:54.2655402Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/b59a9b21-c200-4a77-99fd-c617141f9525.sh
2020-04-15T18:18:54.2655626Z 
2020-04-15T18:18:54.2662359Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-15T18:18:54.2684591Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71174/merge to s
2020-04-15T18:18:54.2688872Z Task         : Get sources
2020-04-15T18:18:54.2689111Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-15T18:18:54.2689446Z Version      : 1.0.0
2020-04-15T18:18:54.2689607Z Author       : Microsoft
---
2020-04-15T18:18:55.2609032Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-15T18:18:55.2619324Z ##[command]git config gc.auto 0
2020-04-15T18:18:55.2626599Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-15T18:18:55.2632474Z ##[command]git config --get-all http.proxy
2020-04-15T18:18:55.2641227Z ##[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/71174/merge:refs/remotes/pull/71174/merge
---
2020-04-15T18:22:16.8226473Z  ---> 78ad2f4d4aca
2020-04-15T18:22:16.8228962Z Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
2020-04-15T18:22:16.8234194Z  ---> Using cache
2020-04-15T18:22:16.8235165Z  ---> 4d2dc61c4d00
2020-04-15T18:22:16.8236752Z 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 &&            /scripts/validate-toolstate.sh
2020-04-15T18:22:16.8239580Z  ---> 776b6266a8b7
2020-04-15T18:22:16.8286649Z Successfully built 776b6266a8b7
2020-04-15T18:22:16.8317386Z Successfully tagged rust-ci:latest
2020-04-15T18:22:17.1438137Z Built container sha256:776b6266a8b7d63e2d3c2b5a784dbf521184a904fb10bf818c6b5c7e1ab74d4a
2020-04-15T18:22:17.1438137Z Built container sha256:776b6266a8b7d63e2d3c2b5a784dbf521184a904fb10bf818c6b5c7e1ab74d4a
2020-04-15T18:22:17.1451744Z Looks like docker image is the same as before, not uploading
2020-04-15T18:22:17.9241809Z [CI_JOB_NAME=mingw-check]
2020-04-15T18:22:17.9471407Z [CI_JOB_NAME=mingw-check]
2020-04-15T18:22:17.9500342Z == clock drift check ==
2020-04-15T18:22:17.9509676Z   local time: Wed Apr 15 18:22:17 UTC 2020
2020-04-15T18:22:18.0400842Z   network time: Wed, 15 Apr 2020 18:22:18 GMT
2020-04-15T18:22:18.0422063Z Starting sccache server...
2020-04-15T18:22:18.1491594Z configure: processing command line
2020-04-15T18:22:18.1492251Z configure: 
2020-04-15T18:22:18.1493428Z configure: rust.parallel-compiler := True
---
2020-04-15T18:26:05.5854312Z     Checking rustc_span v0.0.0 (/checkout/src/librustc_span)
2020-04-15T18:26:10.2625197Z     Checking rustc_errors v0.0.0 (/checkout/src/librustc_errors)
2020-04-15T18:26:11.5010243Z     Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-15T18:26:11.5353369Z     Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-15T18:26:11.7392863Z     Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-15T18:26:12.5658133Z     Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-15T18:26:12.5996541Z     Checking rustc_session v0.0.0 (/checkout/src/librustc_session)
2020-04-15T18:26:14.1551505Z     Checking rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-15T18:26:14.6524314Z     Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
---
2020-04-15T18:26:43.1034361Z      |
2020-04-15T18:26:43.1034825Z 1311 |     ) {
2020-04-15T18:26:43.1037690Z      |       - closing delimiter possibly meant for this
2020-04-15T18:26:43.1038465Z ...
2020-04-15T18:26:43.1039383Z 1316 |             .map(|generator_kind| matches!(generator_kind, hir::GeneratorKind::Async(..))
2020-04-15T18:26:43.1040646Z ...
2020-04-15T18:26:43.1041062Z 1472 |     }
2020-04-15T18:26:43.1041679Z      |     ^ mismatched closing delimiter
2020-04-15T18:26:43.1041933Z 
2020-04-15T18:26:43.1041933Z 
2020-04-15T18:26:43.1080887Z error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
2020-04-15T18:26:43.1082428Z      |
2020-04-15T18:26:43.1082428Z      |
2020-04-15T18:26:43.1083255Z 1316 |             .map(|generator_kind| matches!(generator_kind, hir::GeneratorKind::Async(..))
2020-04-15T18:26:43.1084940Z 1317 |             .unwrap_or(false);
2020-04-15T18:26:43.1084940Z 1317 |             .unwrap_or(false);
2020-04-15T18:26:43.1085646Z      |                              ^ help: `)` may belong here
2020-04-15T18:26:43.1125465Z error: expected expression, found `)`
2020-04-15T18:26:43.1126337Z     --> src/librustc_trait_selection/traits/error_reporting/suggestions.rs:1472:5
2020-04-15T18:26:43.1127177Z      |
2020-04-15T18:26:43.1127597Z 1472 |     }
---
2020-04-15T18:26:44.9992475Z 
2020-04-15T18:26:44.9992860Z To learn more, run the command again with --verbose.
2020-04-15T18:26:44.9993363Z warning: build failed, waiting for other jobs to finish...
2020-04-15T18:26:45.4405328Z error: build failed
2020-04-15T18:26:45.4443201Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
2020-04-15T18:26:45.4447055Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2020-04-15T18:26:45.4447536Z Build completed unsuccessfully in 0:04:27
2020-04-15T18:26:45.4553060Z == clock drift check ==
2020-04-15T18:26:45.4569294Z   local time: Wed Apr 15 18:26:45 UTC 2020
2020-04-15T18:26:45.4569294Z   local time: Wed Apr 15 18:26:45 UTC 2020
2020-04-15T18:26:45.5856918Z   network time: Wed, 15 Apr 2020 18:26:45 GMT
2020-04-15T18:26:46.2564274Z 
2020-04-15T18:26:46.2564274Z 
2020-04-15T18:26:46.2630452Z ##[error]Bash exited with code '1'.
2020-04-15T18:26:46.2645737Z ##[section]Finishing: Run build
2020-04-15T18:26:46.2691349Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71174/merge to s
2020-04-15T18:26:46.2695861Z Task         : Get sources
2020-04-15T18:26:46.2696144Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-15T18:26:46.2696405Z Version      : 1.0.0
2020-04-15T18:26:46.2696580Z Author       : Microsoft
2020-04-15T18:26:46.2696580Z Author       : Microsoft
2020-04-15T18:26:46.2696856Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-15T18:26:46.2697183Z ==============================================================================
2020-04-15T18:26:46.6010618Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-15T18:26:46.6051980Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/71174/merge to s
2020-04-15T18:26:46.6150084Z Cleaning up task key
2020-04-15T18:26:46.6151145Z Start cleaning up orphan processes.
2020-04-15T18:26:46.6329868Z Terminate orphan process: pid (3543) (python)
2020-04-15T18:26:46.7369791Z ##[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)

src/test/compile-fail/issue-68523.rs Outdated Show resolved Hide resolved
src/librustc_metadata/rmeta/decoder.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 15, 2020
@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-04-15T21:34:55.0023914Z ========================== Starting Command Output ===========================
2020-04-15T21:34:55.0026332Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/005aa340-4f51-4db2-83ea-f14106950d59.sh
2020-04-15T21:34:55.0026583Z 
2020-04-15T21:34:55.0030238Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-15T21:34:55.0047926Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71174/merge to s
2020-04-15T21:34:55.0050891Z Task         : Get sources
2020-04-15T21:34:55.0051165Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-15T21:34:55.0051566Z Version      : 1.0.0
2020-04-15T21:34:55.0051738Z Author       : Microsoft
---
2020-04-15T21:34:55.9897508Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-15T21:34:55.9907292Z ##[command]git config gc.auto 0
2020-04-15T21:34:55.9913433Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-15T21:34:55.9919186Z ##[command]git config --get-all http.proxy
2020-04-15T21:34:55.9929336Z ##[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/71174/merge:refs/remotes/pull/71174/merge
---
2020-04-15T21:37:04.4489973Z  ---> f58a2bb1e753
2020-04-15T21:37:04.4499737Z Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-7       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
2020-04-15T21:37:04.4500318Z  ---> Using cache
2020-04-15T21:37:04.4500634Z  ---> d079cc6b6db8
2020-04-15T21:37:04.4501458Z 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
2020-04-15T21:37:04.4502372Z  ---> 4183ca46ee56
2020-04-15T21:37:04.4502556Z Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
2020-04-15T21:37:04.4502874Z  ---> Using cache
2020-04-15T21:37:04.4503175Z  ---> 69e7f8a2a2fb
---
2020-04-15T21:37:04.4875413Z Looks like docker image is the same as before, not uploading
2020-04-15T21:37:12.4984396Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-15T21:37:12.5244816Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-15T21:37:12.5271903Z == clock drift check ==
2020-04-15T21:37:12.5286786Z   local time: Wed Apr 15 21:37:12 UTC 2020
2020-04-15T21:37:12.7521539Z   network time: Wed, 15 Apr 2020 21:37:12 GMT
2020-04-15T21:37:12.7545001Z Starting sccache server...
2020-04-15T21:37:12.8343257Z configure: processing command line
2020-04-15T21:37:12.8343611Z configure: 
2020-04-15T21:37:12.8344595Z configure: rust.dist-src        := False
---
2020-04-15T21:42:03.8018122Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-15T21:42:05.1765445Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-15T21:42:06.6319658Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-15T21:42:07.3880638Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-15T21:42:15.9547011Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-15T21:42:17.8821998Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-15T21:42:21.9734434Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-15T21:42:25.8609363Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-15T21:42:34.7506620Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-15T22:03:25.4618109Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-15T22:03:27.0791310Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-15T22:03:28.9200799Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-15T22:03:30.1134966Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-15T22:03:40.6212349Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-15T22:03:42.8774441Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-15T22:03:47.8375123Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-15T22:03:52.8344543Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-15T22:04:03.9303840Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-15T22:27:58.3312997Z .................................................................................................... 1700/9898
2020-04-15T22:28:02.5161700Z .................................................................................................... 1800/9898
2020-04-15T22:28:10.1161043Z .................................................................................................... 1900/9898
2020-04-15T22:28:17.9592312Z ........i........................................................................................... 2000/9898
2020-04-15T22:28:23.9117197Z ..................................................................................................ii 2100/9898
2020-04-15T22:28:37.3491356Z iii................................................................................................. 2200/9898
2020-04-15T22:28:45.0735546Z .................................................................................................... 2400/9898
2020-04-15T22:28:47.1072305Z .................................................................................................... 2500/9898
2020-04-15T22:28:52.3863605Z .................................................................................................... 2600/9898
2020-04-15T22:29:10.7342807Z .................................................................................................... 2700/9898
---
2020-04-15T22:31:45.2721613Z .................................................................................................... 5100/9898
2020-04-15T22:31:52.5299653Z .................................................................................................... 5200/9898
2020-04-15T22:31:56.8424388Z ...................i................................................................................ 5300/9898
2020-04-15T22:32:06.2351384Z .........i.......................................................................................... 5400/9898
2020-04-15T22:32:11.4979150Z .........ii.ii........i...i......................................................................... 5500/9898
2020-04-15T22:32:18.6493748Z .......................................................i............................................ 5700/9898
2020-04-15T22:32:27.6521779Z ...........................................................................ii....................... 5800/9898
2020-04-15T22:32:33.8909237Z ..............i..................................................................................... 5900/9898
2020-04-15T22:32:38.9689040Z .................................................................................................... 6000/9898
2020-04-15T22:32:38.9689040Z .................................................................................................... 6000/9898
2020-04-15T22:32:49.0043089Z .................................................................................................... 6100/9898
2020-04-15T22:32:59.2140716Z ........ii...i..ii...........i...................................................................... 6200/9898
2020-04-15T22:33:13.3751639Z .................................................................................................... 6400/9898
2020-04-15T22:33:16.6207519Z .................................................................................................... 6500/9898
2020-04-15T22:33:16.6207519Z .................................................................................................... 6500/9898
2020-04-15T22:33:27.9750049Z ......................................i..ii......................................................... 6600/9898
2020-04-15T22:33:49.1571418Z .................................................................................................... 6800/9898
2020-04-15T22:33:51.1471541Z ......................................i............................................................. 6900/9898
2020-04-15T22:33:53.1064242Z .................................................................................................... 7000/9898
2020-04-15T22:33:55.1187885Z .............................................................................i...................... 7100/9898
---
2020-04-15T22:35:26.6120686Z .................................................................................................... 7800/9898
2020-04-15T22:35:30.6519530Z .................................................................................................... 7900/9898
2020-04-15T22:35:36.7620826Z .................................................................................................... 8000/9898
2020-04-15T22:35:42.5294856Z ...........................................i........................................................ 8100/9898
2020-04-15T22:35:51.5123156Z ...........................................................................................iiiiii.ii 8200/9898
2020-04-15T22:35:57.2234842Z iii.i............................................................................................... 8300/9898
2020-04-15T22:36:09.4257582Z .................................................................................................... 8500/9898
2020-04-15T22:36:18.0817520Z .................................................................................................... 8600/9898
2020-04-15T22:36:30.6296713Z .................................................................................................... 8700/9898
2020-04-15T22:36:36.7176358Z .................................................................................................... 8800/9898
---
2020-04-15T22:38:20.3751457Z failures:
2020-04-15T22:38:20.3784732Z 
2020-04-15T22:38:20.3785502Z ---- [ui] ui/async-await/issue-68523-start.rs stdout ----
2020-04-15T22:38:20.3785842Z 
2020-04-15T22:38:20.3786490Z error: /checkout/src/test/ui/async-await/issue-68523-start.rs:6: unexpected error: '6:5: 6:10: start is not allowed to be `async` [E0752]'
2020-04-15T22:38:20.3787041Z error: 1 unexpected errors found, 0 expected errors not found
2020-04-15T22:38:20.3787284Z status: exit code: 1
2020-04-15T22:38:20.3787284Z status: exit code: 1
2020-04-15T22:38:20.3789141Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/async-await/issue-68523-start.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-68523-start" "-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-68523-start/auxiliary"
2020-04-15T22:38:20.3790500Z     Error {
2020-04-15T22:38:20.3790667Z         line_num: 6,
2020-04-15T22:38:20.3790848Z         kind: Some(
2020-04-15T22:38:20.3791030Z             Error,
2020-04-15T22:38:20.3791030Z             Error,
2020-04-15T22:38:20.3791179Z         ),
2020-04-15T22:38:20.3791421Z         msg: "6:5: 6:10: start is not allowed to be `async` [E0752]",
2020-04-15T22:38:20.3791786Z ]
2020-04-15T22:38:20.3791878Z 
2020-04-15T22:38:20.3792576Z thread '[ui] ui/async-await/issue-68523-start.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1460:13
2020-04-15T22:38:20.3792969Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-04-15T22:38:20.3792969Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-04-15T22:38:20.3793159Z 
2020-04-15T22:38:20.3793516Z ---- [ui] ui/async-await/issue-68523.rs stdout ----
2020-04-15T22:38:20.3793670Z 
2020-04-15T22:38:20.3794294Z error: /checkout/src/test/ui/async-await/issue-68523.rs:3: unexpected error: '3:20: 3:35: `main` has invalid return type `impl std::future::Future` [E0277]'
2020-04-15T22:38:20.3794637Z 
2020-04-15T22:38:20.3795214Z error: /checkout/src/test/ui/async-await/issue-68523.rs:3: unexpected error: '3:1: 3:6: `main` function is not allowed to be `async` [E0752]'
2020-04-15T22:38:20.3795702Z error: 2 unexpected errors found, 0 expected errors not found
2020-04-15T22:38:20.3796197Z status: exit code: 1
2020-04-15T22:38:20.3796197Z status: exit code: 1
2020-04-15T22:38:20.3797864Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/async-await/issue-68523.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-68523" "-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-68523/auxiliary"
2020-04-15T22:38:20.3799326Z     Error {
2020-04-15T22:38:20.3799504Z         line_num: 3,
2020-04-15T22:38:20.3799684Z         kind: Some(
2020-04-15T22:38:20.3799855Z             Error,
2020-04-15T22:38:20.3799855Z             Error,
2020-04-15T22:38:20.3800003Z         ),
2020-04-15T22:38:20.3800315Z         msg: "3:20: 3:35: `main` has invalid return type `impl std::future::Future` [E0277]",
2020-04-15T22:38:20.3800737Z     Error {
2020-04-15T22:38:20.3800914Z         line_num: 3,
2020-04-15T22:38:20.3801182Z         kind: Some(
2020-04-15T22:38:20.3801351Z             Error,
2020-04-15T22:38:20.3801351Z             Error,
2020-04-15T22:38:20.3801514Z         ),
2020-04-15T22:38:20.3801766Z         msg: "3:1: 3:6: `main` function is not allowed to be `async` [E0752]",
2020-04-15T22:38:20.3805253Z ]
2020-04-15T22:38:20.3805376Z 
2020-04-15T22:38:20.3806197Z thread '[ui] ui/async-await/issue-68523.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1460:13
2020-04-15T22:38:20.3806475Z 
---
2020-04-15T22:38:20.3808351Z 
2020-04-15T22:38:20.3808862Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-04-15T22:38:20.3819477Z 
2020-04-15T22:38:20.3819648Z 
2020-04-15T22:38:20.3823287Z 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" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-04-15T22:38:20.3825591Z 
2020-04-15T22:38:20.3825684Z 
2020-04-15T22:38:20.3829114Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-04-15T22:38:20.3829465Z Build completed unsuccessfully in 0:59:36
2020-04-15T22:38:20.3829465Z Build completed unsuccessfully in 0:59:36
2020-04-15T22:38:20.3881654Z == clock drift check ==
2020-04-15T22:38:20.3897291Z   local time: Wed Apr 15 22:38:20 UTC 2020
2020-04-15T22:38:20.4785692Z   network time: Wed, 15 Apr 2020 22:38:20 GMT
2020-04-15T22:38:20.9552790Z 
2020-04-15T22:38:20.9552790Z 
2020-04-15T22:38:20.9642962Z ##[error]Bash exited with code '1'.
2020-04-15T22:38:20.9655709Z ##[section]Finishing: Run build
2020-04-15T22:38:20.9699164Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71174/merge to s
2020-04-15T22:38:20.9703694Z Task         : Get sources
2020-04-15T22:38:20.9703975Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-15T22:38:20.9704250Z Version      : 1.0.0
2020-04-15T22:38:20.9704438Z Author       : Microsoft
2020-04-15T22:38:20.9704438Z Author       : Microsoft
2020-04-15T22:38:20.9704736Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-15T22:38:20.9705083Z ==============================================================================
2020-04-15T22:38:21.2872975Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-15T22:38:21.2917789Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/71174/merge to s
2020-04-15T22:38:21.3025389Z Cleaning up task key
2020-04-15T22:38:21.3026567Z Start cleaning up orphan processes.
2020-04-15T22:38:21.3192994Z Terminate orphan process: pid (3421) (python)
2020-04-15T22:38:21.3416348Z ##[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)

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2020
@Nokel81
Copy link
Contributor Author

Nokel81 commented Apr 17, 2020

Done @petrochenkov

@petrochenkov
Copy link
Contributor

r=me after squashing the commits.

* Add new error code E0752
* Add span to hir::IsAsync::Yes
* Emit an error if main or the start function is marked as async
* Add two regression tests

Fix formatting errors and bless test outputs
* move tests to ui/async-await

fix test error text

remove span from IsAsync
@Nokel81
Copy link
Contributor Author

Nokel81 commented Apr 20, 2020

r=petrochenkov

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 20, 2020

📌 Commit 6120ace has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 20, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 21, 2020
Rollup of 4 pull requests

Successful merges:

 - rust-lang#69362 (Stabilize most common subset of alloc_layout_extras)
 - rust-lang#71174 (Check that main/start is not async)
 - rust-lang#71285 (MIR: use HirId instead of NodeId to avoid cycles while inlining)
 - rust-lang#71346 (Do not build tools if user do not want them)

Failed merges:

r? @ghost
@bors bors merged commit e3a514c into rust-lang:master Apr 21, 2020
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.

Bad error message with async main
5 participants