rust
rust copied to clipboard
Rework support for async closures; allow them to return futures that borrow from the closure's captures
This PR implements a new lowering for async closures via TyKind::CoroutineClosure which handles the curious relationship between the closure and the coroutine that it returns.
I wrote up a bunch in this hackmd which will be copied to the dev guide after this PR lands, and hopefully left sufficient comments in the source code explaining why this change is as large as it is.
This also necessitates that they begin implementing the AsyncFn-family of traits, rather than the Fn-family of traits -- if you need Fn implementations, you should probably use the non-sugar || async {} syntax instead.
Notably this PR does not yet implement async Fn() syntax sugar for bounds, but I expect to add those soon (edit: #120392). For now, users must use AsyncFn() traits directly, which necessitates adding the async_fn_traits feature gate as well. I will add this as a follow-up very soon.
r? oli-obk
This is based on top of #120322, but that PR is minimal.
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Fri Jan 26 01:22:27 UTC 2024
network time: Fri, 26 Jan 2024 01:22:27 GMT
network time: Fri, 26 Jan 2024 01:22:27 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
................
failures:
---- [mir-opt] tests/mir-opt/building/async_await.rs stdout ----
5 ty: Coroutine(
6 DefId(0:4 ~ async_await[ccf8]::a::{closure#0}),
+ (),
8 std::future::ResumeTy,
9 (),
10 (),
10 (),
22 ty: Coroutine(
23 DefId(0:4 ~ async_await[ccf8]::a::{closure#0}),
+ (),
25 std::future::ResumeTy,
26 (),
27 (),
27 (),
thread '[mir-opt] tests/mir-opt/building/async_await.rs' panicked at src/tools/compiletest/src/runtest.rs:4130:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir
failures:
[mir-opt] tests/mir-opt/building/async_await.rs
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=rust-cloud-vms[bot]
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_c91f29e3-e0df-491b-a6df-89a59abf962a
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=352fcc47b7bf7d3b68c7eaa91be62b6c265e174e
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_c91f29e3-e0df-491b-a6df-89a59abf962a
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_c91f29e3-e0df-491b-a6df-89a59abf962a
GITHUB_TRIGGERING_ACTOR=rust-cloud-vms[bot]
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120361/merge
GITHUB_WORKFLOW_SHA=352fcc47b7bf7d3b68c7eaa91be62b6c265e174e
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Fri Jan 26 01:43:41 UTC 2024
network time: Fri, 26 Jan 2024 01:43:41 GMT
network time: Fri, 26 Jan 2024 01:43:41 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
diff of stderr:
- error: usage of `ty::TyKind::<kind>`
- --> $DIR/ty_tykind_usage.rs:13:16
+ error[E0004]: non-exhaustive patterns: `TyKind::CoroutineClosure(_, _)` not covered
3 |
- LL | let kind = TyKind::Bool;
- | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
+ LL | match kind {
+ LL | match kind {
+ | ^^^^ pattern `TyKind::CoroutineClosure(_, _)` not covered
- note: the lint level is defined here
- --> $DIR/ty_tykind_usage.rs:11:8
- --> $DIR/ty_tykind_usage.rs:11:8
+ note: `TyKind<TyCtxt<'_>>` defined here
+ --> $COMPILER_DIR/rustc_type_ir/src/ty_kind.rs:124:1
+ ::: $COMPILER_DIR/rustc_type_ir/src/ty_kind.rs:210:5
- LL | #[deny(rustc::usage_of_ty_tykind)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
- error: usage of `ty::TyKind::<kind>`
- error: usage of `ty::TyKind::<kind>`
- --> $DIR/ty_tykind_usage.rs:16:9
+ = note: not covered
+ = note: the matched value is of type `TyKind<TyCtxt<'_>>`
+ help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
- LL | TyKind::Bool => (),
- | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
-
- error: usage of `ty::TyKind::<kind>`
- error: usage of `ty::TyKind::<kind>`
- --> $DIR/ty_tykind_usage.rs:17:9
+ LL ~ TyKind::Error(_) => (),
+ LL ~ TyKind::CoroutineClosure(_, _) => todo!(),
- LL | TyKind::Char => (),
- | ^^^^^^ help: try using `ty::<kind>` directly: `ty`
24
- error: usage of `ty::TyKind::<kind>`
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/internal-lints/ty_tykind_usage.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/ty_tykind_usage" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/internal-lints/ty_tykind_usage/auxiliary" "-Z" "unstable-options"
stdout: none
--- stderr -------------------------------
error[E0004]: non-exhaustive patterns: `TyKind::CoroutineClosure(_, _)` not covered
|
LL | match kind {
LL | match kind {
| ^^^^ pattern `TyKind::CoroutineClosure(_, _)` not covered
|
note: `TyKind<TyCtxt<'_>>` defined here
--> /rustc/FAKE_PREFIX/compiler/rustc_type_ir/src/ty_kind.rs:124:1
|
= note: not covered
= note: not covered
= note: the matched value is of type `TyKind<TyCtxt<'_>>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
LL ~ TyKind::Error(_) => (),
LL ~ TyKind::Error(_) => (),
LL ~ TyKind::CoroutineClosure(_, _) => todo!(), //~ ERROR usage of `ty::TyKind::<kind>`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0004`.
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=rust-cloud-vms[bot]
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_9600e1cf-7c5c-4b2c-8a80-aef6d4370350
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=b30a573ec9f8df0b121350d353bdba855584a2f2
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_9600e1cf-7c5c-4b2c-8a80-aef6d4370350
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_9600e1cf-7c5c-4b2c-8a80-aef6d4370350
GITHUB_TRIGGERING_ACTOR=rust-cloud-vms[bot]
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120361/merge
GITHUB_WORKFLOW_SHA=b30a573ec9f8df0b121350d353bdba855584a2f2
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Checking rustc_mir_dataflow v0.0.0 (/checkout/compiler/rustc_mir_dataflow)
error: unresolved link to `AsyncFn`
--> compiler/rustc_middle/src/middle/lang_items.rs:39:43
|
39 | /// Given a [`DefId`] of one of the [`AsyncFn`], [`AsyncFnMut`] or [`AsyncFnOnce`] traits,
| ^^^^^^^ no item named `AsyncFn` in scope
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
= note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`
error: unresolved link to `AsyncFnMut`
|
|
39 | /// Given a [`DefId`] of one of the [`AsyncFn`], [`AsyncFnMut`] or [`AsyncFnOnce`] traits,
| ^^^^^^^^^^ no item named `AsyncFnMut` in scope
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: unresolved link to `AsyncFnOnce`
--> compiler/rustc_middle/src/middle/lang_items.rs:39:74
--> compiler/rustc_middle/src/middle/lang_items.rs:39:74
|
39 | /// Given a [`DefId`] of one of the [`AsyncFn`], [`AsyncFnMut`] or [`AsyncFnOnce`] traits,
| ^^^^^^^^^^^ no item named `AsyncFnOnce` in scope
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: could not document `rustc_middle`
Caused by:
process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2021 --crate-type lib --crate-name rustc_middle compiler/rustc_middle/src/lib.rs --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/doc --cfg 'feature="rustc-rayon"' --cfg 'feature="rustc-rayon-core"' --cfg 'feature="rustc_use_parallel_compiler"' -Zunstable-options --check-cfg 'cfg(feature, values("rustc-rayon", "rustc-rayon-core", "rustc_use_parallel_compiler"))' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=bb29823b836081c3 -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-0bd70baed0d89864.rmeta --extern derive_more=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/libderive_more-45c4068f16e4a6ca.so --extern either=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libeither-f40e93f54368d30a.rmeta --extern field_offset=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libfield_offset-a237ce08ade21b22.rmeta --extern gsgdt=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgsgdt-9354fa461a012d89.rmeta --extern measureme=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libmeasureme-28941d8a105ff8c9.rmeta --extern polonius_engine=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-73ddc681630ab3be.rmeta --extern rayon=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librayon-83601113ed8e1039.rmeta --extern rayon_core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librayon_core-aeb15957ff3a2a9f.rmeta --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-cdc0620e610e453a.rmeta --extern rustc_arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_arena-d60412acfc04e661.rmeta --extern rustc_ast=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_ast-10314c749b8049f3.rmeta --extern rustc_attr=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_attr-b71aa285415329af.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-1d339e608f97ffbe.rmeta --extern rustc_error_messages=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_error_messages-80d0128d17164fc4.rmeta --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-380b0d8eb5e0794f.rmeta --extern rustc_feature=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_feature-03da752995cf1376.rmeta --extern rustc_fluent_macro=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/librustc_fluent_macro-bd0b9a43da1a5013.so --extern rustc_graphviz=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_graphviz-1946d93325a1f16b.rmeta --extern rustc_hir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_hir-686b1f39b3ed8d97.rmeta --extern rustc_index=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_index-afe9c0792f491de8.rmeta --extern rustc_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/librustc_macros-7dd31ffb1c7715cf.so --extern rustc_query_system=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_query_system-29d4c76ee70ae0b0.rmeta --extern rustc_serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_serialize-8686373d598b91ec.rmeta --extern rustc_session=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_session-0c4da8c64897d9f0.rmeta --extern rustc_span=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-233439e43f17ee70.rmeta --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-853c4ed5a4a889bf.rmeta --extern rustc_type_ir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_type_ir-9293601a3feb4b7f.rmeta --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-480c1d566a726dcb.rmeta --extern thin_vec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libthin_vec-64cd68e8a890cf38.rmeta --extern tracing=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing-5f701b99da500b8b.rmeta --extern-html-root-url 'bitflags=https://docs.rs/bitflags/2.4.1/' --extern-html-root-url 'derive_more=https://docs.rs/derive_more/0.99.17/' --extern-html-root-url 'either=https://docs.rs/either/1.8.1/' --extern-html-root-url 'field_offset=https://docs.rs/field-offset/0.3.6/' --extern-html-root-url 'gsgdt=https://docs.rs/gsgdt/0.1.2/' --extern-html-root-url 'measureme=https://docs.rs/measureme/11.0.1/' --extern-html-root-url 'polonius_engine=https://docs.rs/polonius-engine/0.13.0/' --extern-html-root-url 'rayon=https://docs.rs/rustc-rayon/0.5.0/' --extern-html-root-url 'rayon_core=https://docs.rs/rustc-rayon-core/0.5.0/' --extern-html-root-url 'rustc_apfloat=https://docs.rs/rustc_apfloat/0.2.0+llvm-462a31f5a5ab/' --extern-html-root-url 'smallvec=https://docs.rs/smallvec/1.11.0/' --extern-html-root-url 'thin_vec=https://docs.rs/thin-vec/0.2.13/' --extern-html-root-url 'tracing=https://docs.rs/tracing/0.1.37/' -Zunstable-options --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(parallel_compiler)' '--check-cfg=cfg(no_btreemap_remove_entry)' '--check-cfg=cfg(crossbeam_loom)' '--check-cfg=cfg(span_locations)' '--check-cfg=cfg(rustix_use_libc)' '--check-cfg=cfg(emulate_second_only_system)' '--check-cfg=cfg(windows_raw_dylib)' --document-private-items --document-hidden-items -Dwarnings '-Wrustdoc::invalid_codeblock_attributes' --crate-version '1.77.0-nightly (b30a573ec 2024-01-26)' --document-private-items '-Arustdoc::private-intra-doc-links' --enable-index-page -Zunstable-options -Znormalize-docs --show-type-layout --generate-link-to-definition '-Zcrate-attr=warn(rust_2018_idioms)' --cfg=parallel_compiler --extern-html-root-url 'ena=https://docs.rs/ena/latest/'` (exit status: 1)
Build completed unsuccessfully in 0:00:38
local time: Fri Jan 26 02:42:33 UTC 2024
network time: Fri, 26 Jan 2024 02:42:33 GMT
##[error]Process completed with exit code 1.
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=rust-cloud-vms[bot]
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_4b90885a-1e1c-4622-9ac1-6d25bba87f0e
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=46684a62c4483d5cb2b1e35f1ad67be8befbab50
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_4b90885a-1e1c-4622-9ac1-6d25bba87f0e
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_4b90885a-1e1c-4622-9ac1-6d25bba87f0e
GITHUB_TRIGGERING_ACTOR=rust-cloud-vms[bot]
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120361/merge
GITHUB_WORKFLOW_SHA=46684a62c4483d5cb2b1e35f1ad67be8befbab50
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Fri Jan 26 02:53:26 UTC 2024
network time: Fri, 26 Jan 2024 02:53:26 GMT
network time: Fri, 26 Jan 2024 02:53:26 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
##[endgroup]
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
Finished release [optimized] target(s) in 1.36s
Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --no-default-features --mini-tests --std-tests`
Using system GCC
Using system GCC
[BUILD] example
[AOT] mini_core_hello_world
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core_hello_world
abc
---
---- [ui] tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs stdout ----
diff of stderr:
- WARN rustc_codegen_ssa::mir::locals Unexpected initial operand type: expected std::pin::Pin<&ReErased mut Coroutine(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), [i32, std::future::ResumeTy, (), (), CoroutineWitness(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), []), ()])>, found std::pin::Pin<&ReErased mut Coroutine(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), [i8, std::future::ResumeTy, (), (), CoroutineWitness(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), []), ()])>.See <https://github.com/rust-lang/rust/issues/114858>.
- WARN rustc_codegen_ssa::mir::locals Unexpected initial operand type: expected *mut Coroutine(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), [i8, std::future::ResumeTy, (), (), CoroutineWitness(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), []), ()]), found *mut Coroutine(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), [i32, std::future::ResumeTy, (), (), CoroutineWitness(DefId(0:8 ~ async_fn_once_for_async_fn[6cdf]::main::{closure#0}::{closure#1}), []), ()]).See <https://github.com/rust-lang/rust/issues/114858>.
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-closures/async-fn-once-for-async-fn/async-fn-once-for-async-fn.stderr
Type relation code was changed
cc @compiler-errors, @lcnr
Some changes occurred in need_type_info.rs
cc @lcnr
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
Some changes might have occurred in exhaustiveness checking
cc @Nadrieril
This PR changes MIR
cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras
Some changes occurred in src/tools/clippy
cc @rust-lang/clippy
Some changes occurred in compiler/rustc_codegen_gcc
cc @antoyo, @GuillaumeGomez
Some changes occurred to the CTFE / Miri engine
cc @rust-lang/miri
Some changes occurred to the core trait solver
cc @rust-lang/initiative-trait-system-refactor
:umbrella: The latest upstream changes (presumably #119968) made this pull request unmergeable. Please resolve the merge conflicts.
This also necessitates that they begin implementing the AsyncFn-family of traits, rather than the Fn-family of traits -- if you need Fn implementations, you should probably use the non-sugar || async {} syntax instead.
Is there an issue tracking "closures should be able to return a value borrowed from their captures"?
@RalfJung: Can you explain what you mean? Not really sure what you're asking for.
edit: Maybe you meant why I added the AsyncFn* family of traits? If so, see #119305. I can add elaborate if you'd like.
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=rust-cloud-vms[bot]
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_940b7ff9-505d-4869-9f24-a3dd81fac67a
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=157d572806463d86154d69b2e7d1d51d8d2db13a
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_940b7ff9-505d-4869-9f24-a3dd81fac67a
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_940b7ff9-505d-4869-9f24-a3dd81fac67a
GITHUB_TRIGGERING_ACTOR=rust-cloud-vms[bot]
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120361/merge
GITHUB_WORKFLOW_SHA=157d572806463d86154d69b2e7d1d51d8d2db13a
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Fri Jan 26 14:43:53 UTC 2024
network time: Fri, 26 Jan 2024 14:43:53 GMT
network time: Fri, 26 Jan 2024 14:43:53 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/lib.rs:961:30
|
961 | let lit = if let ExprKind::Lit(token_lit) = expr.kind
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/lib.rs:962:24
|
962 | && let Ok(lit) = MetaItemLit::from_token_lit(token_lit, expr.span)
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/lib.rs:1022:31
|
1022 | } else if let Some(first_char) = constraint.ident.as_str().chars().next()
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/lib.rs:1300:16
|
1300 | && let Some(partial_res) = self.resolver.get_partial_res(t.id)
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/lib.rs:1301:16
|
1301 | && let Some(Res::Def(DefKind::Trait | DefKind::TraitAlias, _)) = partial_res.full_res()
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/delegation.rs:234:30
|
234 | let arg = if let Some(block) = block
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/delegation.rs:328:12
|
328 | if let Some(res) = self.resolver.partial_res_map.get(&id)
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/delegation.rs:329:16
|
329 | && let Some(Res::Local(sig_id)) = res.full_res()
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/expr.rs:554:23
|
554 | let body = if let Some(body) = &arm.body
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/expr.rs:699:16
|
699 | && let Some(attrs) = self.attrs.get(&outer_hir_id.local_id)
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
---
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:40:12
|
40 | if let FormatArgsPiece::Placeholder(placeholder) = &fmt.template[i]
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:41:16
|
41 | && let FormatTrait::Display | FormatTrait::Debug = &placeholder.format_trait
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:42:16
|
42 | && let Ok(arg_index) = placeholder.argument.index
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:43:16
|
43 | && let arg = fmt.arguments.all_args()[arg_index].expr.peel_parens_and_refs()
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:44:16
|
44 | && let ExprKind::FormatArgs(_) = &arg.kind
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:124:12
|
124 | if let FormatTrait::Display = placeholder.format_trait
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:126:16
|
126 | && let arg = fmt.arguments.all_args()[arg_index].expr.peel_parens_and_refs()
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:127:16
|
127 | && let ExprKind::Lit(lit) = arg.kind
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:129:16
|
129 | if let token::LitKind::Str | token::LitKind::StrRaw(_) = lit.kind
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:130:20
|
130 | && let Ok(LitKind::Str(s, _)) = LitKind::from_token_lit(lit)
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:133:23
|
133 | } else if let token::LitKind::Integer = lit.kind
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/format.rs:134:20
|
134 | && let Ok(LitKind::Int(n, _)) = LitKind::from_token_lit(lit)
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/item.rs:1453:35
|
1453 | let host_param_parts = if let Const::Yes(span) = constness
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/lifetime_collector.rs:84:20
|
84 | if let Some(partial_res) = self.resolver.get_partial_res(t.id)
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
error[E0658]: `let` expressions in this position are unstable
--> compiler/rustc_ast_lowering/src/lifetime_collector.rs:85:24
|
85 | && let Some(Res::Def(DefKind::Trait | DefKind::TraitAlias, _)) =
86 | | partial_res.full_res()
| |______________________________________________^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
Can you explain what you mean? Not really sure what you're asking for.
There was discussion $somewhere recently that the Output type of Fn and FnMut should have been generic over the lifetime of the borrow of the closure context. If that was the case then I think we wouldn't need these AsyncFn traits?
I see https://github.com/rust-lang/rust/pull/119305 discusses this to some extent. I just wonder if we should track somewhere the idea of having LendingFn* eventually (or whether it is even possible to make the existing traits lending).
@bors try
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
:hourglass: Trying commit 4dc5109a847038191f0190c91b17c116387ce7d0 with merge e35e259478581c01033b8da67214c0d376859a32...
:sunny: Try build successful - checks-actions
Build commit: e35e259478581c01033b8da67214c0d376859a32 (e35e259478581c01033b8da67214c0d376859a32)
Queued e35e259478581c01033b8da67214c0d376859a32 with parent fb4bca04fa1bde2f7db1b31a59e066f7bebd7fc6, future comparison URL. There are currently 0 preceding artifacts in the queue. It will probably take at least ~1.2 hours until the benchmark run finishes.
didn't mean to start perf, meant to start crater
@craterbot check
:ok_hand: Experiment pr-120361 created and queued.
:robot: Automatically detected try build e35e259478581c01033b8da67214c0d376859a32
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:construction: Experiment pr-120361 is now running
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
Finished benchmarking commit (e35e259478581c01033b8da67214c0d376859a32): comparison URL.
Overall result: ❌✅ regressions and improvements - ACTION NEEDED
Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.
Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.
@bors rollup=never @rustbot label: -S-waiting-on-perf +perf-regression
Instruction count
This is a highly reliable metric that was used to determine the overall result at the top of this comment.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
4.7% | [1.4%, 14.1%] | 6 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.2% | [-0.2%, -0.2%] | 1 |
| All ❌✅ (primary) | 4.7% | [1.4%, 14.1%] | 6 |
Max RSS (memory usage)
Results
This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
3.4% | [1.4%, 5.8%] | 5 |
| Regressions ❌ (secondary) |
3.9% | [2.0%, 10.6%] | 5 |
| Improvements ✅ (primary) |
-3.2% | [-3.2%, -3.2%] | 1 |
| Improvements ✅ (secondary) |
-4.9% | [-4.9%, -4.9%] | 1 |
| All ❌✅ (primary) | 2.3% | [-3.2%, 5.8%] | 6 |
Cycles
Results
This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
4.6% | [1.8%, 13.4%] | 6 |
| Regressions ❌ (secondary) |
2.5% | [1.4%, 3.3%] | 6 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | 4.6% | [1.8%, 13.4%] | 6 |
Binary size
This benchmark run did not return any relevant results for this metric.
Bootstrap: 660.078s -> 663.858s (0.57%) Artifact size: 308.02 MiB -> 308.05 MiB (0.01%)
The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=rust-cloud-vms[bot]
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_f5feb38a-3ed8-4052-8655-de642faada2e
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=84070b943985b07ebd0ab01b32ff29cca256ef48
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_f5feb38a-3ed8-4052-8655-de642faada2e
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_f5feb38a-3ed8-4052-8655-de642faada2e
GITHUB_TRIGGERING_ACTOR=rust-cloud-vms[bot]
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120361/merge
GITHUB_WORKFLOW_SHA=84070b943985b07ebd0ab01b32ff29cca256ef48
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
#12 writing image sha256:8fa5dd82129a3cc644048908c9ebb164225dfdd15e2fb22a1318f061f36609b7 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.0s
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
local time: Mon Jan 29 19:43:37 UTC 2024
network time: Mon, 29 Jan 2024 19:43:37 GMT
network time: Mon, 29 Jan 2024 19:43:37 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
..................
failures:
---- [mir-opt] tests/mir-opt/async_closure_shims.rs stdout ----
1 // MIR for `main::{closure#0}::{closure#0}::{closure#0}` 0 coroutine_by_mut
3 | User Type Annotations
3 | User Type Annotations
- | 0: user_ty: Canonical { value: TypeOf(DefId(2:9996 ~ core[4e0f]::fmt::{impl#2}::new_v1), UserArgs { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon })], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9993 ~ core[4e0f]::fmt::{impl#2}), self_ty: std::fmt::Arguments<ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon })> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $SRC_DIR/std/src/macros.rs:LL:COL, inferred_ty: fn(&[&'static str], &[core::fmt::rt::Argument<'_>]) -> std::fmt::Arguments<'_> {std::fmt::Arguments::<'_>::new_v1}
- | 1: user_ty: Canonical { value: TypeOf(DefId(2:9916 ~ core[4e0f]::fmt::rt::{impl#1}::new_display), UserArgs { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }), ^1], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9911 ~ core[4e0f]::fmt::rt::{impl#1}), self_ty: core::fmt::rt::Argument<ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon })> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/async_closure_shims.rs:40:35: 40:38, inferred_ty: for<'b> fn(&'b i32) -> core::fmt::rt::Argument<'b> {core::fmt::rt::Argument::<'_>::new_display::<i32>}
- | 2: user_ty: Canonical { value: TypeOf(DefId(2:9916 ~ core[4e0f]::fmt::rt::{impl#1}::new_display), UserArgs { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }), ^1], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9911 ~ core[4e0f]::fmt::rt::{impl#1}), self_ty: core::fmt::rt::Argument<ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon })> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/async_closure_shims.rs:40:43: 40:46, inferred_ty: for<'b> fn(&'b i32) -> core::fmt::rt::Argument<'b> {core::fmt::rt::Argument::<'_>::new_display::<i32>}
+ | 0: user_ty: Canonical { value: TypeOf(DefId(2:9994 ~ core[9c45]::fmt::{impl#2}::new_v1), UserArgs { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon })], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9991 ~ core[9c45]::fmt::{impl#2}), self_ty: std::fmt::Arguments<ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon })> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $SRC_DIR/std/src/macros.rs:LL:COL, inferred_ty: fn(&[&'static str], &[core::fmt::rt::Argument<'_>]) -> std::fmt::Arguments<'_> {std::fmt::Arguments::<'_>::new_v1}
+ | 1: user_ty: Canonical { value: TypeOf(DefId(2:9914 ~ core[9c45]::fmt::rt::{impl#1}::new_display), UserArgs { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }), ^1], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9909 ~ core[9c45]::fmt::rt::{impl#1}), self_ty: core::fmt::rt::Argument<ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon })> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/async_closure_shims.rs:40:35: 40:38, inferred_ty: for<'b> fn(&'b i32) -> core::fmt::rt::Argument<'b> {core::fmt::rt::Argument::<'_>::new_display::<i32>}
+ | 2: user_ty: Canonical { value: TypeOf(DefId(2:9914 ~ core[9c45]::fmt::rt::{impl#1}::new_display), UserArgs { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }), ^1], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9909 ~ core[9c45]::fmt::rt::{impl#1}), self_ty: core::fmt::rt::Argument<ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon })> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/async_closure_shims.rs:40:43: 40:46, inferred_ty: for<'b> fn(&'b i32) -> core::fmt::rt::Argument<'b> {core::fmt::rt::Argument::<'_>::new_display::<i32>}
7 |
8 fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:39:53: 41:10}, _2: ResumeTy) -> ()
9 yields ()
thread '[mir-opt] tests/mir-opt/async_closure_shims.rs' panicked at src/tools/compiletest/src/runtest.rs:4130:21:
thread '[mir-opt] tests/mir-opt/async_closure_shims.rs' panicked at src/tools/compiletest/src/runtest.rs:4130:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.panic-unwind.mir
failures:
[mir-opt] tests/mir-opt/async_closure_shims.rs
Ok, very strange for this to have such a dramatic effect on perf.
@bors try @rust-timer queue
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
:hourglass: Trying commit e9c9d2367357aa45180656a66b1c28c25fddcc4e with merge 44dcf112275bc6421bb9e1c12844e60f3b284a1c...
:sunny: Try build successful - checks-actions
Build commit: 44dcf112275bc6421bb9e1c12844e60f3b284a1c (44dcf112275bc6421bb9e1c12844e60f3b284a1c)
Queued 44dcf112275bc6421bb9e1c12844e60f3b284a1c with parent fb4bca04fa1bde2f7db1b31a59e066f7bebd7fc6, future comparison URL. There is currently 1 preceding artifact in the queue. It will probably take at least ~2.3 hours until the benchmark run finishes.
Finished benchmarking commit (44dcf112275bc6421bb9e1c12844e60f3b284a1c): comparison URL.
Overall result: ❌✅ regressions and improvements - no action needed
Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.
@bors rollup=never @rustbot label: -S-waiting-on-perf -perf-regression
Instruction count
This is a highly reliable metric that was used to determine the overall result at the top of this comment.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
0.3% | [0.3%, 0.3%] | 1 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.2% | [-0.2%, -0.2%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
Results
This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
1.7% | [1.7%, 1.7%] | 1 |
| Regressions ❌ (secondary) |
6.0% | [1.5%, 10.5%] | 2 |
| Improvements ✅ (primary) |
-2.3% | [-6.6%, -1.0%] | 18 |
| Improvements ✅ (secondary) |
-2.3% | [-3.7%, -0.9%] | 47 |
| All ❌✅ (primary) | -2.1% | [-6.6%, 1.7%] | 19 |
Cycles
Results
This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
2.6% | [1.2%, 3.6%] | 6 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
Binary size
This benchmark run did not return any relevant results for this metric.
Bootstrap: 660.078s -> 662.981s (0.44%) Artifact size: 308.02 MiB -> 308.07 MiB (0.02%)
:tada: Experiment pr-120361 is completed!
:bar_chart: 52 regressed and 5 fixed (412230 total)
:newspaper: Open the full report.
:warning: If you notice any spurious failure please add them to the blacklist! :information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
These regressions are unsurprising, and I'd like to eventually re-support using async closures in Fn/FnMut when possible (exactly when there are no borrows from the closure type). Most of them aren't even ascribing the return type, which is one beneficial usage of async closures right now, so they can just write async move || like || async move.
This is ready for review.
I think by tomorrow I won't be able anymore to replicate whatever model I think I have in my head without rereading the code, but right now I have convinced myself I understand the traits, fields and helper trait dance.
@bors r+
:pushpin: Commit 0dd43928ba01fc9e8fda82e19810fa9ce4731e21 has been approved by oli-obk
It is now in the queue for this repository.