Relocate coroutine upvars into Unresumed state
Related to #62958
This PR is an attempt to address the async/coroutine size issue by allowing independent def-use/liveness analysis on individual upvars in coroutines. It has appeared to address partially the size doubling issue introduced by the use of upvars.
However, there are caveats detailed in the following list that I would like to address before turning this draft in.
- The treatment here towards the
ty::Coroutinein MIR passes is unfortunately "messier" than my liking, which is something I definitely want to change. I propose to promote upvars intoBody<'tcx>along withlocal_decls, so that we can safely handle them safely. I would happily open a new separate PR to improve the upvar management. - It is not a generic solution, yet. For instance, we are still doubling the size in the example of #62958. If we insert a pass before MIR type analysis to remove unnecessary drops, which we can, that particular size doubling will be solved. However, if a
Futureupvar is alive across more than one yield points, that upvar is still ineligible. It makes sense because we would like to minimize moving of variant fields. How to handle these upvars is not the focus of this PR for now.
Out of expectation of possible change in the high level plan, I am keeping this as a draft in hope of invoking conversations. :bow:
cc @pnkfelix for the context.
r? @petrochenkov
(rustbot has picked a reviewer for you, use r? to override)
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=dingxiangfei2009
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_d7624f57-f958-4bc9-bb74-57078c1758b5
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=5598b2baf7c3d7f4501244a7a5df813f2e0253ee
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_d7624f57-f958-4bc9-bb74-57078c1758b5
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_d7624f57-f958-4bc9-bb74-57078c1758b5
GITHUB_TRIGGERING_ACTOR=dingxiangfei2009
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120168/merge
GITHUB_WORKFLOW_SHA=5598b2baf7c3d7f4501244a7a5df813f2e0253ee
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: Sat Jan 20 18:41:31 UTC 2024
network time: Sat, 20 Jan 2024 18:41:32 GMT
network time: Sat, 20 Jan 2024 18:41:32 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]
##[group]Testing stage2 compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu)
running 155 tests
iiiiii..............i..i.ii......i...i.F............i...........Fiiiii....ii.........i.. 88/155
failures:
---- [debuginfo-gdb] tests/debuginfo/coroutine-objects.rs stdout ----
---- [debuginfo-gdb] tests/debuginfo/coroutine-objects.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 13001000
error: check directive(s) from `/checkout/tests/debuginfo/coroutine-objects.rs` not found in debugger output. errors:
(coroutine-objects.rs:14) `$1 = coroutine_objects::main::{coroutine_env#0}::Unresumed{_ref__a: 0x[...]}`
(coroutine-objects.rs:17) `$2 = coroutine_objects::main::{coroutine_env#0}::Suspend0{c: 6, d: 7, _ref__a: 0x[...]}`
(coroutine-objects.rs:20) `$3 = coroutine_objects::main::{coroutine_env#0}::Suspend1{c: 7, d: 8, _ref__a: 0x[...]}`
(coroutine-objects.rs:23) `$4 = coroutine_objects::main::{coroutine_env#0}::Returned{_ref__a: 0x[...]}`
status: exit status: 0
command: PYTHONPATH="/checkout/./src/etc" "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/coroutine-objects.gdb/coroutine-objects.debugger.script"
GNU gdb (Ubuntu 13.1-2ubuntu2.1) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x14fb: file /checkout/tests/debuginfo/coroutine-objects.rs, line 86.
Breakpoint 2 at 0x154b: file /checkout/tests/debuginfo/coroutine-objects.rs, line 88.
Breakpoint 3 at 0x157c: file /checkout/tests/debuginfo/coroutine-objects.rs, line 90.
Breakpoint 4 at 0x15ab: file /checkout/tests/debuginfo/coroutine-objects.rs, line 92.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:86
86 _zzz(); // #break
$1 = coroutine_objects::main::{coroutine_env#0}::Unresumed(0x7fffffffdf6c)
Breakpoint 2, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:88
88 _zzz(); // #break
$2 = coroutine_objects::main::{coroutine_env#0}::Suspend0{c: 6, d: 7, __2: 0x7fffffffdf6c}
Breakpoint 3, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:90
90 _zzz(); // #break
$3 = coroutine_objects::main::{coroutine_env#0}::Suspend1{c: 7, d: 8, __2: 0x7fffffffdf6c}
Breakpoint 4, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:92
92 _zzz(); // #break
$4 = coroutine_objects::main::{coroutine_env#0}::Returned
Inferior 1 [process 145654] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal]
stderr: none
---- [debuginfo-gdb] tests/debuginfo/issue-57822.rs stdout ----
---- [debuginfo-gdb] tests/debuginfo/issue-57822.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 13001000
error: check directive(s) from `/checkout/tests/debuginfo/issue-57822.rs` not found in debugger output. errors:
(issue-57822.rs:17) `$2 = issue_57822::main::{coroutine_env#3}::Unresumed{a: issue_57822::main::{coroutine_env#2}::Unresumed{y: 2}}`
the following subset of check directive(s) was found successfully:
(issue-57822.rs:14) `$1 = issue_57822::main::{closure_env#1} {f: issue_57822::main::{closure_env#0} {x: 1}}`
status: exit status: 0
command: PYTHONPATH="/checkout/./src/etc" "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/issue-57822.gdb/issue-57822.debugger.script"
GNU gdb (Ubuntu 13.1-2ubuntu2.1) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x134f: file /checkout/tests/debuginfo/issue-57822.rs, line 50.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, issue_57822::main () at /checkout/tests/debuginfo/issue-57822.rs:50
50 zzz(); // #break
$1 = issue_57822::main::{closure_env#1} {f: issue_57822::main::{closure_env#0} {x: 1}}
$2 = issue_57822::main::{coroutine_env#3}::Unresumed(issue_57822::main::{coroutine_env#2}::Unresumed(2))
Inferior 1 [process 146487] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal]
stderr: none
r? @pnkfelix
:umbrella: The latest upstream changes (presumably #116152) made this pull request unmergeable. Please resolve the merge conflicts.
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=dingxiangfei2009
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_1c1e588a-9ba2-40d8-a6ba-773cff3516db
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=0bb86b5f96e0575a57ab1ae0ca80f8194289806e
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_1c1e588a-9ba2-40d8-a6ba-773cff3516db
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_1c1e588a-9ba2-40d8-a6ba-773cff3516db
GITHUB_TRIGGERING_ACTOR=dingxiangfei2009
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/120168/merge
GITHUB_WORKFLOW_SHA=0bb86b5f96e0575a57ab1ae0ca80f8194289806e
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: Sat Jan 27 21:04:01 UTC 2024
network time: Sat, 27 Jan 2024 21:04:01 GMT
network time: Sat, 27 Jan 2024 21:04:01 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]
##[group]Testing stage2 compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu)
running 155 tests
iiiiii..............i..i.ii......i...iF.............i............iiiii.F..ii.........i.. 88/155
failures:
---- [debuginfo-gdb] tests/debuginfo/coroutine-objects.rs stdout ----
---- [debuginfo-gdb] tests/debuginfo/coroutine-objects.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 13001000
error: check directive(s) from `/checkout/tests/debuginfo/coroutine-objects.rs` not found in debugger output. errors:
(coroutine-objects.rs:14) `$1 = coroutine_objects::main::{coroutine_env#0}::Unresumed{_ref__a: 0x[...]}`
(coroutine-objects.rs:17) `$2 = coroutine_objects::main::{coroutine_env#0}::Suspend0{c: 6, d: 7, _ref__a: 0x[...]}`
(coroutine-objects.rs:20) `$3 = coroutine_objects::main::{coroutine_env#0}::Suspend1{c: 7, d: 8, _ref__a: 0x[...]}`
(coroutine-objects.rs:23) `$4 = coroutine_objects::main::{coroutine_env#0}::Returned{_ref__a: 0x[...]}`
status: exit status: 0
command: PYTHONPATH="/checkout/./src/etc" "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/coroutine-objects.gdb/coroutine-objects.debugger.script"
GNU gdb (Ubuntu 13.1-2ubuntu2.1) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
Build completed unsuccessfully in 0:13:28
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x14fb: file /checkout/tests/debuginfo/coroutine-objects.rs, line 86.
Breakpoint 2 at 0x154b: file /checkout/tests/debuginfo/coroutine-objects.rs, line 88.
Breakpoint 3 at 0x157c: file /checkout/tests/debuginfo/coroutine-objects.rs, line 90.
Breakpoint 4 at 0x15ab: file /checkout/tests/debuginfo/coroutine-objects.rs, line 92.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:86
86 _zzz(); // #break
$1 = coroutine_objects::main::{coroutine_env#0}::Unresumed(0x7fffffffdf6c)
Breakpoint 2, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:88
88 _zzz(); // #break
$2 = coroutine_objects::main::{coroutine_env#0}::Suspend0{c: 6, d: 7, __2: 0x7fffffffdf6c}
Breakpoint 3, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:90
90 _zzz(); // #break
$3 = coroutine_objects::main::{coroutine_env#0}::Suspend1{c: 7, d: 8, __2: 0x7fffffffdf6c}
Breakpoint 4, coroutine_objects::main () at /checkout/tests/debuginfo/coroutine-objects.rs:92
92 _zzz(); // #break
$4 = coroutine_objects::main::{coroutine_env#0}::Returned
Inferior 1 [process 145889] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal]
stderr: none
---- [debuginfo-gdb] tests/debuginfo/issue-57822.rs stdout ----
---- [debuginfo-gdb] tests/debuginfo/issue-57822.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 13001000
error: check directive(s) from `/checkout/tests/debuginfo/issue-57822.rs` not found in debugger output. errors:
(issue-57822.rs:17) `$2 = issue_57822::main::{coroutine_env#3}::Unresumed{a: issue_57822::main::{coroutine_env#2}::Unresumed{y: 2}}`
the following subset of check directive(s) was found successfully:
(issue-57822.rs:14) `$1 = issue_57822::main::{closure_env#1} {f: issue_57822::main::{closure_env#0} {x: 1}}`
status: exit status: 0
command: PYTHONPATH="/checkout/./src/etc" "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/issue-57822.gdb/issue-57822.debugger.script"
GNU gdb (Ubuntu 13.1-2ubuntu2.1) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x134f: file /checkout/tests/debuginfo/issue-57822.rs, line 50.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, issue_57822::main () at /checkout/tests/debuginfo/issue-57822.rs:50
50 zzz(); // #break
$1 = issue_57822::main::{closure_env#1} {f: issue_57822::main::{closure_env#0} {x: 1}}
$2 = issue_57822::main::{coroutine_env#3}::Unresumed(issue_57822::main::{coroutine_env#2}::Unresumed(2))
Inferior 1 [process 146709] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal]
stderr: none
@dingxiangfei2009 am I right in assuming that the debugger test failure is expected and you plan to address it if we move forward with this approach?
In any case, this is interesting work, and I think its a step in the right direction.
I plan to build it locally and take it for a spin, to make sure I understand what its doing. @dingxiangfei2009, I may ping you on Zulip with follow-up questions.
@pnkfelix Thank you for reviewing! Yes, the debuginfo test may very much depend on how the upvars are eventually represented. I figured that I shall fix them after we could settle with our approach first.
Please feel free to message on Zulip!
:umbrella: The latest upstream changes (presumably #120361) made this pull request unmergeable. Please resolve the merge conflicts.
Thanks for your patience @dingxiangfei2009 . This all looks good to me; I wouldn't mind getting an answer to my question about the new handling of dropping upvar state, but I also think this is ready to land, assuming it doesn't conflict with @compiler-errors 's ongoing work on async closures etc.
@rustbot author
@bors try @rust-timer queue
:lock: Merge conflict
This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.
How do I rebase?
Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:
-
git checkout coroutine-upvar(switch to your branch) -
git fetch upstream master(retrieve the latest master) -
git rebase upstream/master -p(rebase on top of it) - Follow the on-screen instruction to resolve conflicts (check
git statusif you got lost). -
git push self coroutine-upvar --force-with-lease(update this PR)
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.
Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.
Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.
Error message
Auto-merging tests/ui/coroutine/clone-impl.stderr
Auto-merging tests/ui/async-await/issue-70935-complex-spans.stderr
Auto-merging tests/ui/async-await/future-sizes/future-as-arg.rs
Auto-merging tests/ui/async-await/async-await-let-else.stderr
Auto-merging compiler/rustc_ty_utils/src/layout.rs
Auto-merging compiler/rustc_mir_transform/src/dest_prop.rs
Auto-merging compiler/rustc_mir_transform/src/coroutine.rs
Auto-merging compiler/rustc_mir_dataflow/src/rustc_peek.rs
Auto-merging compiler/rustc_middle/src/ty/sty.rs
Auto-merging compiler/rustc_middle/src/ty/layout.rs
Auto-merging compiler/rustc_middle/src/mir/tcx.rs
Auto-merging compiler/rustc_const_eval/src/transform/validate.rs
Auto-merging compiler/rustc_const_eval/src/interpret/step.rs
Auto-merging compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Auto-merging compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs
Auto-merging compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
Auto-merging compiler/rustc_codegen_cranelift/src/base.rs
Auto-merging compiler/rustc_borrowck/src/type_check/mod.rs
CONFLICT (content): Merge conflict in compiler/rustc_borrowck/src/type_check/mod.rs
Auto-merging compiler/rustc_abi/src/lib.rs
Automatic merge failed; fix conflicts and then commit the result.
Oh, also: Just in case its potentially of interest to others, part of the reason this took me so long to get to is that I wanted a pair of pernos.co runs, one from before and one from after this PR, to make it easier for me to explore the control flow interactively (and to help me understand some of the differences in output from our internal compiler instrumentation like print-type-sizes)
Here's links to those in case anyone else wants to inspect them:
- Before: https://pernos.co/debug/JHlinh-cWSwzHKGoZRiTeQ/index.html
- After: https://pernos.co/debug/SEXi12zlbIZomhOhyuoegg/index.html
Progress update: I am still on it to polish it up. I will try to get the rust-timer numbers this week.
The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Running tests/compile-test.rs (obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/compile_test-a5cda42c39d70683)
FAILED TEST: tests/ui/future_not_send.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-7dc543e856f87725.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-f8a01377ac0ff203.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-0f3bb1d43666e40c.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-dd131ad522aed9e0.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-9152caa60d22e5d6.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-389517e109d775ca.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-93d7303c6012a33b.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-2d43560082bb21c6.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-969c152412fe4d84.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-b0de0647ab33f326.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-f944c6c97a7094c6.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-eddc5a1e301140d8.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/future_not_send.rs" "--edition" "2021"
error: actual output differed from expected
thread 'main' panicked at src/tools/clippy/tests/compile-test.rs:176:6:
called `Result::unwrap()` on an `Err` value: tests failed
---
error: future cannot be sent between threads safely
--> tests/ui/future_not_send.rs:7:1
... 3 lines skipped ...
|
note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:7:67
|
|
-LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
+LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
- | -- has type `std::rc::Rc<[u8]>` which is not `Send`
-LL |
+ | |
-LL | async { true }.await
-LL | async { true }.await
+ | ___________________________________________________________________await occurs here, with the value maybe used later
- | ^^^^^ await occurs here, with `rc` maybe used later
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
-note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:7:67
|
|
-LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
+LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
- | ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
= note: `-D clippy::future-not-send` implied by `-D warnings`
... 7 lines skipped ...
|
|
note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:12:42
|
|
-LL | pub async fn public_future(rc: Rc<[u8]>) {
+LL | pub async fn public_future(rc: Rc<[u8]>) {
- | -- has type `std::rc::Rc<[u8]>` which is not `Send`
-LL |
+ | |
-LL | async { true }.await;
-LL | async { true }.await;
+ | __________________________________________await occurs here, with the value maybe used later
- | ^^^^^ await occurs here, with `rc` maybe used later
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
... 4 lines skipped ...
... 4 lines skipped ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
-note: captured value is not `Send`
-note: captured value is not `Send`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:21:68
|
|
-LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
+LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
- | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
-note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:21:68
|
|
-LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
+LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
- | ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
... 4 lines skipped ...
... 4 lines skipped ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
-note: captured value is not `Send`
-note: captured value is not `Send`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:26:43
|
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
- | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
+ | ^-
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
... 5 lines skipped ...
|
|
note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:38:45
|
-LL | async fn private_future(&self) -> usize {
+LL | async fn private_future(&self) -> usize {
+LL | async fn private_future(&self) -> usize {
- | ----- has type `&Dummy` which is not `Send`
-LL |
+ | |
-LL | async { true }.await;
-LL | async { true }.await;
+ | _____________________________________________await occurs here, with the value maybe used later
- | ^^^^^ await occurs here, with `&self` maybe used later
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
... 4 lines skipped ...
... 4 lines skipped ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
|
-note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:44:39
|
-LL | pub async fn public_future(&self) {
+LL | pub async fn public_future(&self) {
+LL | pub async fn public_future(&self) {
- | ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
... 22 lines skipped ...
... 22 lines skipped ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
-note: captured value is not `Send`
-note: captured value is not `Send`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:73:34
|
|
LL | async fn unclear_future<T>(t: T) {}
- | ^ has type `T` which is not `Send`
+ | ^-
= note: `T` doesn't implement `std::marker::Send`
error: aborting due to 8 previous errors
full stderr:
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:7:1
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| |
| |
| ___________________________________________________________________await occurs here, with the value maybe used later
LL | |
LL | | async { true }.await
LL | | }
LL | | }
| |_- has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
note: future is not `Send` as this value is used across an await
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| |
| |
| ___________________________________________________________________await occurs here, with the value maybe used later
LL | |
LL | | async { true }.await
LL | | }
LL | | }
| |_- has type `&std::cell::Cell<usize>` which is not `Send`
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
= note: `-D clippy::future-not-send` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:12:1
|
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
| |
| |
| __________________________________________await occurs here, with the value maybe used later
LL | |
LL | | async { true }.await;
LL | | }
LL | | }
| |_- has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:21:1
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| |
| |
| ____________________________________________________________________await occurs here, with the value maybe used later
LL | |
LL | | true
LL | | }
LL | | }
| |_- has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
note: future is not `Send` as this value is used across an await
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| |
| |
| ____________________________________________________________________await occurs here, with the value maybe used later
LL | |
LL | | true
LL | | }
LL | | }
| |_- has type `&std::cell::Cell<usize>` which is not `Send`
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:26:1
|
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
| ^-
| |
| await occurs here, with `{}` maybe used later
| has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:38:5
|
LL | async fn private_future(&self) -> usize {
LL | async fn private_future(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
LL | async fn private_future(&self) -> usize {
| ^
| |
| |
| _____________________________________________await occurs here, with the value maybe used later
LL | |
LL | | async { true }.await;
LL | | self.rc.len()
LL | | }
LL | | }
| |_____- has type `&Dummy` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:44:5
|
LL | pub async fn public_future(&self) {
LL | pub async fn public_future(&self) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
LL | pub async fn public_future(&self) {
| ^
| |
| |
| _______________________________________await occurs here, with the value maybe used later
LL | |
LL | | self.private_future().await;
LL | | }
LL | | }
| |_____- has type `&Dummy` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:55:1
|
|
LL | / async fn generic_future<T>(t: T) -> T
LL | | where
LL | | T: Send,
LL | | T: Send,
| |____________^ future returned by `generic_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
LL | let rt = &t;
LL | let rt = &t;
| -- has type `&T` which is not `Send`
LL | async { true }.await;
| ^^^^^ await occurs here, with `rt` maybe used later
= note: `T` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:73:1
|
|
LL | async fn unclear_future<T>(t: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
|
LL | async fn unclear_future<T>(t: T) {}
| ^-
| |
| await occurs here, with `{}` maybe used later
| has type `T` which is not `Send`
= note: `T` doesn't implement `std::marker::Send`
error: aborting due to 8 previous errors
full stdout:
full stdout:
FAILED TEST: tests/ui/large_futures.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-7dc543e856f87725.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-f8a01377ac0ff203.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-0f3bb1d43666e40c.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-dd131ad522aed9e0.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-9152caa60d22e5d6.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-389517e109d775ca.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-93d7303c6012a33b.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-2d43560082bb21c6.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-969c152412fe4d84.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-b0de0647ab33f326.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-f944c6c97a7094c6.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-eddc5a1e301140d8.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/large_futures.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/large_futures.stderr` to the actual output
--- tests/ui/large_futures.stderr
+++ <stderr output>
+++ <stderr output>
error: large future with a size of 16385 bytes
--> tests/ui/large_futures.rs:11:9
... 29 lines skipped ...
| ^^^^^ help: consider `Box::pin` on it: `Box::pin(foo())`
-error: large future with a size of 49159 bytes
+error: large future with a size of 32774 bytes
--> tests/ui/large_futures.rs:35:5
|
|
... 47 lines skipped ...
error: aborting due to 8 previous errors
error: `large future with a size of 49159 bytes` not found in diagnostics on line 35
|
|
36 | //~^ ERROR: large future with a size of 49159 bytes
|
full stderr:
error: large future with a size of 16385 bytes
error: large future with a size of 16385 bytes
##[error] --> tests/ui/large_futures.rs:11:9
|
LL | big_fut([0u8; 1024 * 16]).await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Box::pin` on it: `Box::pin(big_fut([0u8; 1024 * 16]))`
= note: `-D clippy::large-futures` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_futures)]`
error: large future with a size of 16386 bytes
error: large future with a size of 16386 bytes
##[error] --> tests/ui/large_futures.rs:15:5
|
LL | f.await
| ^ help: consider `Box::pin` on it: `Box::pin(f)`
error: large future with a size of 16387 bytes
##[error] --> tests/ui/large_futures.rs:20:9
|
LL | wait().await;
LL | wait().await;
| ^^^^^^ help: consider `Box::pin` on it: `Box::pin(wait())`
error: large future with a size of 16387 bytes
##[error] --> tests/ui/large_futures.rs:25:13
|
LL | wait().await;
LL | wait().await;
| ^^^^^^ help: consider `Box::pin` on it: `Box::pin(wait())`
error: large future with a size of 65540 bytes
##[error] --> tests/ui/large_futures.rs:33:5
|
LL | foo().await;
LL | foo().await;
| ^^^^^ help: consider `Box::pin` on it: `Box::pin(foo())`
error: large future with a size of 32774 bytes
##[error] --> tests/ui/large_futures.rs:35:5
|
|
LL | calls_fut(fut).await;
| ^^^^^^^^^^^^^^ help: consider `Box::pin` on it: `Box::pin(calls_fut(fut))`
error: large future with a size of 65540 bytes
##[error] --> tests/ui/large_futures.rs:48:5
|
LL | / async {
LL | / async {
LL | |
LL | | let x = [0i32; 1024 * 16];
LL | | async {}.await;
LL | | }
| |_____^
|
|
help: consider `Box::pin` on it
|
LL ~ Box::pin(async {
LL +
LL + let x = [0i32; 1024 * 16];
LL + async {}.await;
LL + println!("{:?}", x);
LL + })
error: large future with a size of 65540 bytes
##[error] --> tests/ui/large_futures.rs:60:13
|
|
LL | / async {
LL | | let x = [0i32; 1024 * 16];
LL | | async {}.await;
LL | | println!("macro: {:?}", x);
| |_____________^
...
...
LL | macro_!().await
|
= note: this error originates in the macro `macro_` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `macro_` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider `Box::pin` on it
|
LL ~ Box::pin(async {
LL + let x = [0i32; 1024 * 16];
LL + async {}.await;
LL + println!("macro: {:?}", x);
LL + })
error: aborting due to 8 previous errors
full stdout:
FAILED TEST: tests/ui/needless_lifetimes.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-7dc543e856f87725.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-f8a01377ac0ff203.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-0f3bb1d43666e40c.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-dd131ad522aed9e0.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-9152caa60d22e5d6.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-389517e109d775ca.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-93d7303c6012a33b.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-2d43560082bb21c6.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-969c152412fe4d84.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-b0de0647ab33f326.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-f944c6c97a7094c6.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-eddc5a1e301140d8.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/needless_lifetimes.rs" "--edition" "2021" "--extern" "proc_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui/auxiliary/libproc_macros.so" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui/auxiliary"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/needless_lifetimes.stderr` to the actual output
--- tests/ui/needless_lifetimes.stderr
+++ <stderr output>
+++ <stderr output>
error: the following explicit lifetimes could be elided: 'a, 'b
... 551 lines skipped ...
|
-error: aborting due to 46 previous errors
-error: aborting due to 46 previous errors
+error: this `MutexGuard` is held across an `await` point
+error: aborting due to 47 previous errors
+
full stderr:
error: the following explicit lifetimes could be elided: 'a, 'b
|
|
LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
| ^^ ^^ ^^ ^^
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
|
|
LL - fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
LL + fn distinct_lifetimes(_x: &u8, _y: &u8, _z: u8) {}
error: the following explicit lifetimes could be elided: 'a, 'b
|
|
LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
| ^^ ^^ ^^ ^^
help: elide the lifetimes
|
|
LL - fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
LL + fn distinct_and_static(_x: &u8, _y: &u8, _z: &'static u8) {}
error: the following explicit lifetimes could be elided: 'a
|
|
LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
| ^^ ^^ ^^
help: elide the lifetimes
|
|
LL - fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
LL + fn in_and_out(x: &u8, _y: u8) -> &u8 {
error: the following explicit lifetimes could be elided: 'b
|
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#17 exporting to docker image format
#17 sending tarball 45.1s done
#17 DONE 55.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-17]
---
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-17', '--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', '--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-17/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 ----
1 // MIR for `a::{closure#0}` 0 coroutine_resume
2 /* coroutine_layout = CoroutineLayout {
+ upvar_start: _0,
3 field_tys: {},
4 variant_fields: {
5 Unresumed(0): [],
6 Returned (1): [],
7 Panicked (2): [],
8 },
+ field_names: {},
+ field_names: {},
9 storage_conflicts: BitMatrix(0x0) {},
10 } */
thread '[mir-opt] tests/mir-opt/building/async_await.rs' panicked at src/tools/compiletest/src/runtest.rs:4351:21:
thread '[mir-opt] tests/mir-opt/building/async_await.rs' panicked at src/tools/compiletest/src/runtest.rs:4351:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/building/async_await.a-{closure#0}.coroutine_resume.0.mir
Build completed unsuccessfully in 0:14:22
---- [mir-opt] tests/mir-opt/coroutine_tiny.rs stdout ----
---- [mir-opt] tests/mir-opt/coroutine_tiny.rs stdout ----
1 // MIR for `main::{closure#0}` 0 coroutine_resume
2 /* coroutine_layout = CoroutineLayout {
+ upvar_start: _1,
3 field_tys: {
4 _0: CoroutineSavedTy {
5 ty: HasDrop,
15 Returned (1): [],
16 Panicked (2): [],
16 Panicked (2): [],
17 Suspend0 (3): [_0],
+ field_names: {
+ _0: Some(
+ "_d",
+ ),
+ ),
18 },
19 storage_conflicts: BitMatrix(1x1) {
20 (_0, _0),
thread '[mir-opt] tests/mir-opt/coroutine_tiny.rs' panicked at src/tools/compiletest/src/runtest.rs:4351:21:
thread '[mir-opt] tests/mir-opt/coroutine_tiny.rs' panicked at src/tools/compiletest/src/runtest.rs:4351:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/coroutine_tiny.main-{closure#0}.coroutine_resume.0.mir
---- [mir-opt] tests/mir-opt/inline_coroutine_body.rs stdout ----
22 }
22 }
23 + scope 7 (inlined ActionPermit::<'_, T>::perform::{closure#0}) {
24 + debug _task_context => _31;
- + debug self => ((*(_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6})).0: ActionPermit<'_, T>);
+ + debug self => (((*(_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6})) as variant#0).0: ActionPermit<'_, T>);
26 + let _11: ActionPermit<'_, T>;
27 + let mut _12: std::future::Ready<()>;
28 + let mut _13: std::future::Ready<()>;
183 + _31 = move _9;
183 + _31 = move _9;
184 + _34 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6});
185 + _35 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6});
- + (((*_34) as variant#3).0: ActionPermit<'_, T>) = move ((*_35).0: ActionPermit<'_, T>);
+ + (((*_34) as variant#3).0: ActionPermit<'_, T>) = move (((*_35) as variant#0).0: ActionPermit<'_, T>);
187 + StorageLive(_12);
188 + StorageLive(_13);
189 + StorageLive(_14);
thread '[mir-opt] tests/mir-opt/inline_coroutine_body.rs' panicked at src/tools/compiletest/src/runtest.rs:4351:21:
thread '[mir-opt] tests/mir-opt/inline_coroutine_body.rs' panicked at src/tools/compiletest/src/runtest.rs:4351:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff
failures:
[mir-opt] tests/mir-opt/building/async_await.rs
[mir-opt] tests/mir-opt/coroutine_tiny.rs
The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
FAILED TEST: tests/pass/async-closure.rs
Error:
0: tests failed
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-8KSUgA" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/tests/pass" "tests/pass/async-closure.rs" "--edition" "2021"
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: pass test got exit status: 101, but expected 0
error: actual output differed from expected
Execute `./miri test --bless` to update `tests/pass/async-closure.stderr` to the actual output
Execute `./miri test --bless` to update `tests/pass/async-closure.stderr` to the actual output
--- tests/pass/async-closure.stderr
+++ <stderr output>
+error: internal compiler error: /checkout/compiler/rustc_const_eval/src/interpret/place.rs:LL:CC: type mismatch when copying!
+ src: DropMe,
+ dest: &DropMe
+ |
+ |
+LL | let async_closure = async move |a: DropMe| {
+
+thread 'rustc' panicked at /checkout/compiler/rustc_const_eval/src/interpret/place.rs:LL:CC:
+Box<dyn Any>
+stack backtrace:
+stack backtrace:
error: test failed, to rerun pass `--test ui`
Caused by:
process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/ui-320b39d6474aa336 --quiet` (exit status: 1)
+ 0: $HEX - <std[e716cf1fe5d918c6]::sys_common::backtrace::_print::DisplayBacktrace as core[9377e06f844e4bc8]::fmt::Display>::fmt
+ 1: $HEX - core[9377e06f844e4bc8]::fmt::write
+ 2: $HEX - <std[e716cf1fe5d918c6]::sys::pal::PLATFORM::stdio::Stderr as std[e716cf1fe5d918c6]::io::Write>::write_fmt
+ 3: $HEX - std[e716cf1fe5d918c6]::sys_common::backtrace::print
+ 4: $HEX - std[e716cf1fe5d918c6]::panicking::default_hook::{closure#1}
+ 5: $HEX - std[e716cf1fe5d918c6]::panicking::default_hook
+ 6: $HEX - <alloc[b2fd6b8b52329bee]::boxed::Box<rustc_driver_impl[e6536b17848271a6]::install_ice_hook::{closure#0}> as core[9377e06f844e4bc8]::ops::function::Fn<(&dyn for<'a, 'b> core[9377e06f844e4bc8]::ops::function::Fn<(&'a core[9377e06f844e4bc8]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[9377e06f844e4bc8]::marker::Sync + core[9377e06f844e4bc8]::marker::Send, &core[9377e06f844e4bc8]::panic::panic_info::PanicInfo)>>::call
+ 7: $HEX - std[e716cf1fe5d918c6]::panicking::rust_panic_with_hook
+ 8: $HEX - std[e716cf1fe5d918c6]::panicking::begin_panic::{closure#0}
+ 9: $HEX - std[e716cf1fe5d918c6]::sys_common::backtrace::__rust_end_short_backtrace
+ 10: $HEX - std[e716cf1fe5d918c6]::panicking::begin_panic
+ 11: $HEX - <rustc_errors[5ef309bf41597e1b]::diagnostic::BugAbort as rustc_errors[5ef309bf41597e1b]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
+ 12: $HEX - <rustc_errors[5ef309bf41597e1b]::DiagCtxt>::span_bug
+ 13: $HEX - rustc_middle[d8e8766896fe9c0d]::util::bug::opt_span_bug_fmt::{closure#0}
+ 14: $HEX - rustc_middle[d8e8766896fe9c0d]::ty::context::tls::with_opt::{closure#0}
+ 15: $HEX - rustc_middle[d8e8766896fe9c0d]::ty::context::tls::with_context_opt
+ 16: $HEX - rustc_middle[d8e8766896fe9c0d]::util::bug::span_bug_fmt
+ 17: $HEX - <rustc_const_eval[28a414bfabda2d27]::interpret::eval_context::InterpCx<miri[d4177bcf4f49994a]::machine::MiriMachine>>::copy_op_no_validate
+ 18: $HEX - <rustc_const_eval[28a414bfabda2d27]::interpret::eval_context::InterpCx<miri[d4177bcf4f49994a]::machine::MiriMachine>>::eval_rvalue_into_place
+ 19: $HEX - <rustc_const_eval[28a414bfabda2d27]::interpret::eval_context::InterpCx<miri[d4177bcf4f49994a]::machine::MiriMachine> as miri[d4177bcf4f49994a]::concurrency::thread::EvalContextExt>::run_threads
+ 20: $HEX - miri[d4177bcf4f49994a]::eval::eval_entry
+ 21: $HEX - <rustc_middle[d8e8766896fe9c0d]::ty::context::GlobalCtxt>::enter
+ 22: $HEX - <miri[d0458b10443b185]::MiriCompilerCalls as rustc_driver_impl[e6536b17848271a6]::Callbacks>::after_analysis
+ 23: $HEX - <rustc_interface[57340c66e6001f5b]::interface::Compiler>::enter
+ 24: $HEX - rustc_span[f5ce67fc76e5688d]::set_source_map
+ 25: $HEX - rustc_span[f5ce67fc76e5688d]::create_session_globals_then
+ 26: $HEX - std[e716cf1fe5d918c6]::sys_common::backtrace::__rust_begin_short_backtrace
+ 27: $HEX - <<std[e716cf1fe5d918c6]::thread::Builder>::spawn_unchecked_<rustc_interface[57340c66e6001f5b]::util::run_in_thread_with_globals<rustc_interface[57340c66e6001f5b]::util::run_in_thread_pool_with_globals<rustc_interface[57340c66e6001f5b]::interface::run_compiler<core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>, rustc_driver_impl[e6536b17848271a6]::run_compiler::{closure#0}>::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#1} as core[9377e06f844e4bc8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
+ 28: $HEX - <std[e716cf1fe5d918c6]::sys::pal::PLATFORM::thread::Thread>::new::thread_start
+ 29: $HEX - <unknown>
+ 30: $HEX - <unknown>
+
+note: we would appreciate a bug report: https://github.com/rust-lang/miri/issues/new
+
+
+warning: the ICE couldn't be written to `/checkout/src/tools/miri/rustc-ice-2024-03-24T18_26_39-51358.txt`: Read-only file system (os error 30)
+note: rustc 1.79.0-nightly (e73dc4c38 2024-03-24) running on x86_64-unknown-linux-gnu
+
+note: compiler flags: -Z ui-testing
+
+
+query stack during panic:
+end of query stack
+
+Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
+note: the place in the program where the ICE was triggered
+ |
+ |
+LL | let async_closure = async move |a: DropMe| {
+ |
+ = note: BACKTRACE:
+ = note: inside closure at $DIR/async-closure.rs:LL:CC
+note: inside closure
+note: inside closure
+ --> $DIR/async-closure.rs:LL:CC
+ |
+LL | f(DropMe("world")).await;
+note: inside closure
+ --> $DIR/async-closure.rs:LL:CC
+ |
+ |
+LL | call_once(async_closure).await;
+ | ^^^^^
+note: inside `block_on::<(), {async block@$DIR/async-closure.rs:LL:CC}>`
+ |
+ |
+LL | match fut.as_mut().poll(ctx) {
+note: inside `main`
+ --> $DIR/async-closure.rs:LL:CC
+ |
+ |
+LL | / block_on(async {
+LL | | let b = DropMe("hello");
+LL | | let async_closure = async move |a: DropMe| {
+LL | | println!("{a:?} {b:?}");
+LL | | };
+LL | | call_once(async_closure).await;
+ | |______^
+ = note: inside `<fn() as std::ops::FnOnce<()>>::call_once - shim(fn())` at RUSTLIB/core/src/ops/function.rs:LL:CC
+ = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
+ = note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
+ = note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
+ = note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at RUSTLIB/core/src/ops/function.rs:LL:CC
+ = note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC
+ = note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC
+ = note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panic.rs:LL:CC
+ = note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
+ = note: inside `std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#2}}, isize>` at RUSTLIB/std/src/panicking.rs:LL:CC
+ = note: inside `std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#2}}>` at RUSTLIB/std/src/panicking.rs:LL:CC
+ = note: inside `std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#2}}, isize>` at RUSTLIB/std/src/panic.rs:LL:CC
+ = note: inside `std::rt::lang_start::<()>` at RUSTLIB/std/src/rt.rs:LL:CC
+
+error: aborting due to 1 previous error
+
+
error: actual output differed from expected
Execute `./miri test --bless` to update `tests/pass/async-closure.stdout` to the actual output
+++ <stdout output>
+++ <stdout output>
-DropMe("world") DropMe("hello")
-hello
error: there were 1 unmatched diagnostics
error: there were 1 unmatched diagnostics
##[error] --> tests/pass/async-closure.rs:35:29
|
35 | let async_closure = async move |a: DropMe| {
| ^^^^^^^^^^^^^^^^^^^^^^ Ice: /checkout/compiler/rustc_const_eval/src/interpret/place.rs:849:13: type mismatch when copying!
src: DropMe,
dest: &DropMe
full stderr:
##[error]error: internal compiler error: /checkout/compiler/rustc_const_eval/src/interpret/place.rs:849:13: type mismatch when copying!
src: DropMe,
src: DropMe,
dest: &DropMe
--> tests/pass/async-closure.rs:35:29
|
LL | let async_closure = async move |a: DropMe| {
thread 'rustc' panicked at /checkout/compiler/rustc_const_eval/src/interpret/place.rs:849:13:
Box<dyn Any>
stack backtrace:
stack backtrace:
0: 0x7fcf26665e2f - <std[e716cf1fe5d918c6]::sys_common::backtrace::_print::DisplayBacktrace as core[9377e06f844e4bc8]::fmt::Display>::fmt
1: 0x7fcf266bea65 - core[9377e06f844e4bc8]::fmt::write
2: 0x7fcf2665b099 - <std[e716cf1fe5d918c6]::sys::pal::unix::stdio::Stderr as std[e716cf1fe5d918c6]::io::Write>::write_fmt
3: 0x7fcf26665bfe - std[e716cf1fe5d918c6]::sys_common::backtrace::print
4: 0x7fcf26668bda - std[e716cf1fe5d918c6]::panicking::default_hook::{closure#1}
5: 0x7fcf26668907 - std[e716cf1fe5d918c6]::panicking::default_hook
6: 0x7fcf27230648 - <alloc[b2fd6b8b52329bee]::boxed::Box<rustc_driver_impl[e6536b17848271a6]::install_ice_hook::{closure#0}> as core[9377e06f844e4bc8]::ops::function::Fn<(&dyn for<'a, 'b> core[9377e06f844e4bc8]::ops::function::Fn<(&'a core[9377e06f844e4bc8]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[9377e06f844e4bc8]::marker::Sync + core[9377e06f844e4bc8]::marker::Send, &core[9377e06f844e4bc8]::panic::panic_info::PanicInfo)>>::call
7: 0x7fcf266692dd - std[e716cf1fe5d918c6]::panicking::rust_panic_with_hook
8: 0x7fcf2a858b46 - std[e716cf1fe5d918c6]::panicking::begin_panic::<rustc_errors[5ef309bf41597e1b]::ExplicitBug>::{closure#0}
9: 0x7fcf2a858936 - std[e716cf1fe5d918c6]::sys_common::backtrace::__rust_end_short_backtrace::<std[e716cf1fe5d918c6]::panicking::begin_panic<rustc_errors[5ef309bf41597e1b]::ExplicitBug>::{closure#0}, !>
10: 0x7fcf271aefa6 - std[e716cf1fe5d918c6]::panicking::begin_panic::<rustc_errors[5ef309bf41597e1b]::ExplicitBug>
11: 0x7fcf2a862661 - <rustc_errors[5ef309bf41597e1b]::diagnostic::BugAbort as rustc_errors[5ef309bf41597e1b]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
12: 0x560af87b0158 - <rustc_errors[5ef309bf41597e1b]::DiagCtxt>::span_bug::<rustc_span[f5ce67fc76e5688d]::span_encoding::Span, alloc[b2fd6b8b52329bee]::string::String>
13: 0x560af89b391f - rustc_middle[d8e8766896fe9c0d]::util::bug::opt_span_bug_fmt::<rustc_span[f5ce67fc76e5688d]::span_encoding::Span>::{closure#0}
14: 0x560af89b396a - rustc_middle[d8e8766896fe9c0d]::ty::context::tls::with_opt::<rustc_middle[d8e8766896fe9c0d]::util::bug::opt_span_bug_fmt<rustc_span[f5ce67fc76e5688d]::span_encoding::Span>::{closure#0}, !>::{closure#0}
15: 0x560af89b171b - rustc_middle[d8e8766896fe9c0d]::ty::context::tls::with_context_opt::<rustc_middle[d8e8766896fe9c0d]::ty::context::tls::with_opt<rustc_middle[d8e8766896fe9c0d]::util::bug::opt_span_bug_fmt<rustc_span[f5ce67fc76e5688d]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
16: 0x560af86f4dca - rustc_middle[d8e8766896fe9c0d]::util::bug::span_bug_fmt::<rustc_span[f5ce67fc76e5688d]::span_encoding::Span>
17: 0x560af8824ff8 - <rustc_const_eval[28a414bfabda2d27]::interpret::eval_context::InterpCx<miri[d4177bcf4f49994a]::machine::MiriMachine>>::copy_op_no_validate::<rustc_const_eval[28a414bfabda2d27]::interpret::operand::OpTy<miri[d4177bcf4f49994a]::machine::Provenance>, rustc_const_eval[28a414bfabda2d27]::interpret::place::PlaceTy<miri[d4177bcf4f49994a]::machine::Provenance>>
18: 0x560af88491eb - <rustc_const_eval[28a414bfabda2d27]::interpret::eval_context::InterpCx<miri[d4177bcf4f49994a]::machine::MiriMachine>>::eval_rvalue_into_place
19: 0x560af8883f09 - <rustc_const_eval[28a414bfabda2d27]::interpret::eval_context::InterpCx<miri[d4177bcf4f49994a]::machine::MiriMachine> as miri[d4177bcf4f49994a]::concurrency::thread::EvalContextExt>::run_threads
20: 0x560af880443e - miri[d4177bcf4f49994a]::eval::eval_entry
21: 0x560af8702c4b - <rustc_middle[d8e8766896fe9c0d]::ty::context::GlobalCtxt>::enter::<<miri[d0458b10443b185]::MiriCompilerCalls as rustc_driver_impl[e6536b17848271a6]::Callbacks>::after_analysis::{closure#0}, ()>
22: 0x560af86faae9 - <miri[d0458b10443b185]::MiriCompilerCalls as rustc_driver_impl[e6536b17848271a6]::Callbacks>::after_analysis
23: 0x7fcf2723fe84 - <rustc_interface[57340c66e6001f5b]::interface::Compiler>::enter::<rustc_driver_impl[e6536b17848271a6]::run_compiler::{closure#0}::{closure#1}, core[9377e06f844e4bc8]::result::Result<core[9377e06f844e4bc8]::option::Option<rustc_interface[57340c66e6001f5b]::queries::Linker>, rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>
24: 0x7fcf271fa823 - rustc_span[f5ce67fc76e5688d]::set_source_map::<core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>, rustc_interface[57340c66e6001f5b]::interface::run_compiler<core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>, rustc_driver_impl[e6536b17848271a6]::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
25: 0x7fcf271fc562 - rustc_span[f5ce67fc76e5688d]::create_session_globals_then::<core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>, rustc_interface[57340c66e6001f5b]::util::run_in_thread_pool_with_globals<rustc_interface[57340c66e6001f5b]::interface::run_compiler<core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>, rustc_driver_impl[e6536b17848271a6]::run_compiler::{closure#0}>::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#0}>
26: 0x7fcf272cbfbe - std[e716cf1fe5d918c6]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[57340c66e6001f5b]::util::run_in_thread_with_globals<rustc_interface[57340c66e6001f5b]::util::run_in_thread_pool_with_globals<rustc_interface[57340c66e6001f5b]::interface::run_compiler<core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>, rustc_driver_impl[e6536b17848271a6]::run_compiler::{closure#0}>::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>
27: 0x7fcf272cf141 - <<std[e716cf1fe5d918c6]::thread::Builder>::spawn_unchecked_<rustc_interface[57340c66e6001f5b]::util::run_in_thread_with_globals<rustc_interface[57340c66e6001f5b]::util::run_in_thread_pool_with_globals<rustc_interface[57340c66e6001f5b]::interface::run_compiler<core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>, rustc_driver_impl[e6536b17848271a6]::run_compiler::{closure#0}>::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9377e06f844e4bc8]::result::Result<(), rustc_span[f5ce67fc76e5688d]::ErrorGuaranteed>>::{closure#1} as core[9377e06f844e4bc8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
28: 0x7fcf26674462 - <std[e716cf1fe5d918c6]::sys::pal::unix::thread::Thread>::new::thread_start
30: 0x7fcf263cd850 - <unknown>
31: 0x0 - <unknown>
note: we would appreciate a bug report: https://github.com/rust-lang/miri/issues/new
note: we would appreciate a bug report: https://github.com/rust-lang/miri/issues/new
warning: the ICE couldn't be written to `/checkout/src/tools/miri/rustc-ice-2024-03-24T18_26_39-51358.txt`: Read-only file system (os error 30)
note: rustc 1.79.0-nightly (e73dc4c38 2024-03-24) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z ui-testing
query stack during panic:
end of query stack
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
|
|
LL | let async_closure = async move |a: DropMe| {
|
= note: BACKTRACE:
= note: inside closure at tests/pass/async-closure.rs:35:29: 35:51
note: inside closure
note: inside closure
--> tests/pass/async-closure.rs:20:5
|
LL | f(DropMe("world")).await;
note: inside closure
--> tests/pass/async-closure.rs:38:34
|
|
LL | call_once(async_closure).await;
| ^^^^^
note: inside `block_on::<(), {async block@tests/pass/async-closure.rs:33:14: 39:6}>`
|
|
LL | match fut.as_mut().poll(ctx) {
note: inside `main`
--> tests/pass/async-closure.rs:33:5
|
|
LL | / block_on(async {
LL | | let b = DropMe("hello");
LL | | let async_closure = async move |a: DropMe| {
LL | | println!("{a:?} {b:?}");
LL | | };
LL | | call_once(async_closure).await;
| |______^
= note: inside `<fn() as std::ops::FnOnce<()>>::call_once - shim(fn())` at /checkout/library/core/src/ops/function.rs:250:5: 250:71
= note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>` at /checkout/library/std/src/sys_common/backtrace.rs:155:18: 155:21
= note: inside closure at /checkout/library/std/src/rt.rs:166:18: 166:82
= note: inside closure at /checkout/library/std/src/rt.rs:166:18: 166:82
= note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at /checkout/library/core/src/ops/function.rs:284:13: 284:31
= note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at /checkout/library/std/src/panicking.rs:552:40: 552:43
= note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at /checkout/library/std/src/panicking.rs:516:19: 516:88
= note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at /checkout/library/std/src/panic.rs:146:14: 146:33
= note: inside closure at /checkout/library/std/src/rt.rs:148:48: 148:73
= note: inside `std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#2}}, isize>` at /checkout/library/std/src/panicking.rs:552:40: 552:43
= note: inside `std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#2}}>` at /checkout/library/std/src/panicking.rs:516:19: 516:88
= note: inside `std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#2}}, isize>` at /checkout/library/std/src/panic.rs:146:14: 146:33
= note: inside `std::rt::lang_start::<()>` at /checkout/library/std/src/rt.rs:165:17: 170:6
error: aborting due to 1 previous error
Some changes occurred in src/tools/clippy
cc @rust-lang/clippy
Some changes occurred in compiler/rustc_codegen_cranelift
cc @bjorn3
Some changes occurred to the CTFE / Miri engine
cc @rust-lang/miri
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
:umbrella: The latest upstream changes (presumably #123065) made this pull request unmergeable. Please resolve the merge conflicts.
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 exporting to docker image format
#16 sending tarball 29.0s done
#16 DONE 42.1s
##[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-17]
---
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-17', '--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', '--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-17/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
7 = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
8 = note: `#[warn(incomplete_features)]` on by default
9
- error: future cannot be sent between threads safely
+ error[E0277]: `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }` cannot be sent between threads safely
12 |
12 |
+ LL | async fn foo<T: Foo>() -> Result<(), ()> {
+ | ---------------------------------------- within this `impl Future<Output = Result<(), ()>>`
+ ...
13 LL | is_send(foo::<T>());
- | ^^^^^^^^^^ future returned by `foo` is not `Send`
+ | ------- ^^^^^^^^^^ `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }` cannot be sent between threads safely
+ | required by a bound introduced by this call
15 |
15 |
16 = help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is required by `impl Future<Output = Result<(), ()>>: Send`
- note: future is not `Send` as it awaits another future which is not `Send`
- --> $DIR/basic.rs:13:5
+ note: required because it's used within this `async` fn body
19 |
19 |
- LL | T::method().await?;
- | ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is not `Send`
+ LL | async fn foo<T: Foo>() -> Result<(), ()> {
+ | __________________________________________^
+ LL | | T::method().await?;
+ LL | | Ok(())
+ LL | | }
22 note: required by a bound in `is_send`
23 --> $DIR/basic.rs:17:20
24 |
---
30
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-type-bounds/return-type-notation/basic.without/basic.without.stderr
To only update this specific test, also pass `--test-args associated-type-bounds/return-type-notation/basic.rs`
error in revision `without`: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/associated-type-bounds/return-type-notation/basic.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" "--cfg" "without" "--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/associated-type-bounds/return-type-notation/basic.without" "-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/associated-type-bounds/return-type-notation/basic.without/auxiliary" "--edition=2021"
--- stderr -------------------------------
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
##[warning] --> /checkout/tests/ui/associated-type-bounds/return-type-notation/basic.rs:5:12
|
|
LL | #![feature(return_type_notation)]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
= note: `#[warn(incomplete_features)]` on by default
error[E0277]: `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }` cannot be sent between threads safely
|
|
LL | async fn foo<T: Foo>() -> Result<(), ()> {
| ---------------------------------------- within this `impl Future<Output = Result<(), ()>>`
...
LL | is_send(foo::<T>());
| ------- ^^^^^^^^^^ `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is required by `impl Future<Output = Result<(), ()>>: Send`
note: required because it's used within this `async` fn body
|
LL | async fn foo<T: Foo>() -> Result<(), ()> {
| __________________________________________^
| __________________________________________^
LL | | T::method().await?;
LL | | }
| |_^
note: required by a bound in `is_send`
--> /checkout/tests/ui/associated-type-bounds/return-type-notation/basic.rs:17:20
--> /checkout/tests/ui/associated-type-bounds/return-type-notation/basic.rs:17:20
|
LL | fn is_send(_: impl Send) {}
error: aborting due to 1 previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0277`.
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---- [ui] tests/ui/async-await/async-await-let-else.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `Rc<()>` cannot be sent between threads safely
3 |
3 |
+ LL | async fn foo(x: Option<bool>) {
+ | ----------------------------- within this `impl Future<Output = ()>`
+ ...
4 LL | is_send(foo(Some(true)));
- | ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
+ | ------- ^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
- --> $DIR/async-await-let-else.rs:8:15
+ note: required because it's used within this `async` fn body
10 |
10 |
- LL | let r = Rc::new(());
- | - has type `Rc<()>` which is not `Send`
- LL | bar().await
- | ^^^^^ await occurs here, with `r` maybe used later
+ LL | async fn foo(x: Option<bool>) {
+ | _______________________________^
+ LL | | let Some(_) = x else {
+ LL | | let r = Rc::new(());
+ LL | | bar().await
+ LL | | };
+ LL | | }
15 note: required by a bound in `is_send`
16 --> $DIR/async-await-let-else.rs:16:15
17 |
54 LL | fn is_send<T: Send>(_: T) {}
56
- error: future cannot be sent between threads safely
- error: future cannot be sent between threads safely
+ error[E0277]: `Rc<()>` cannot be sent between threads safely
59 |
59 |
+ LL | async fn foo3(x: Option<bool>) {
+ | ------------------------------ within this `impl Future<Output = ()>`
+ ...
60 LL | is_send(foo3(Some(true)));
- | ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
+ | ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
+ | required by a bound introduced by this call
62 |
62 |
63 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
- --> $DIR/async-await-let-else.rs:30:29
+ note: required because it's used within this `async` fn body
66 |
66 |
- LL | (Rc::new(()), bar().await);
- | ----------- ^^^^^ await occurs here, with `Rc::new(())` maybe used later
- | |
- | has type `Rc<()>` which is not `Send`
+ LL | async fn foo3(x: Option<bool>) {
+ | ________________________________^
+ LL | | let Some(_) = x else {
+ LL | | (Rc::new(()), bar().await);
+ LL | | return;
+ LL | | };
+ LL | | }
71 note: required by a bound in `is_send`
72 --> $DIR/async-await-let-else.rs:16:15
73 |
74 LL | fn is_send<T: Send>(_: T) {}
76
- error: future cannot be sent between threads safely
- error: future cannot be sent between threads safely
+ error[E0277]: `Rc<()>` cannot be sent between threads safely
79 |
79 |
+ LL | async fn foo4(x: Option<bool>) {
+ | ------------------------------ within this `impl Future<Output = ()>`
+ ...
80 LL | is_send(foo4(Some(true)));
- | ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
+ | ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
+ | required by a bound introduced by this call
82 |
82 |
83 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
- --> $DIR/async-await-let-else.rs:38:15
+ note: required because it's used within this `async` fn body
86 |
86 |
- LL | let r = Rc::new(());
- | - has type `Rc<()>` which is not `Send`
- LL | bar().await;
- | ^^^^^ await occurs here, with `r` maybe used later
+ LL | async fn foo4(x: Option<bool>) {
+ | ________________________________^
+ LL | | let Some(_) = x else {
+ LL | | let r = Rc::new(());
+ LL | | bar().await;
+ LL | | };
+ LL | | }
+ | |_^
91 note: required by a bound in `is_send`
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/async-await-let-else.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/async-await/async-await-let-else" "-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/async-await/async-await-let-else/auxiliary" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0277]: `Rc<()>` cannot be sent between threads safely
|
|
LL | async fn foo(x: Option<bool>) {
| ----------------------------- within this `impl Future<Output = ()>`
...
LL | is_send(foo(Some(true)));
| ------- ^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
note: required because it's used within this `async` fn body
|
LL | async fn foo(x: Option<bool>) {
| _______________________________^
LL | | let Some(_) = x else {
LL | | let Some(_) = x else {
LL | | let r = Rc::new(());
LL | | bar().await
LL | | }
| |_^
note: required by a bound in `is_send`
--> /checkout/tests/ui/async-await/async-await-let-else.rs:16:15
--> /checkout/tests/ui/async-await/async-await-let-else.rs:16:15
|
LL | fn is_send<T: Send>(_: T) {}
error[E0277]: `Rc<()>` cannot be sent between threads safely
|
|
LL | async fn foo2(x: Option<bool>) {
| ------------------------------ within this `impl Future<Output = ()>`
...
...
LL | is_send(foo2(Some(true)));
| ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
note: required because it's used within this `async` fn body
|
|
LL | async fn bar2<T>(_: T) -> ! {
LL | | panic!()
LL | | }
| |_^
note: required because it's used within this `async` fn body
note: required because it's used within this `async` fn body
--> /checkout/tests/ui/async-await/async-await-let-else.rs:18:32
|
LL | async fn foo2(x: Option<bool>) {
| ________________________________^
LL | | let Some(_) = x else {
LL | | bar2(Rc::new(())).await
LL | | }
| |_^
note: required by a bound in `is_send`
--> /checkout/tests/ui/async-await/async-await-let-else.rs:16:15
--> /checkout/tests/ui/async-await/async-await-let-else.rs:16:15
|
LL | fn is_send<T: Send>(_: T) {}
error[E0277]: `Rc<()>` cannot be sent between threads safely
|
|
LL | async fn foo3(x: Option<bool>) {
| ------------------------------ within this `impl Future<Output = ()>`
...
LL | is_send(foo3(Some(true)));
| ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
note: required because it's used within this `async` fn body
|
LL | async fn foo3(x: Option<bool>) {
| ________________________________^
LL | | let Some(_) = x else {
LL | | let Some(_) = x else {
LL | | (Rc::new(()), bar().await);
LL | | };
LL | | }
| |_^
note: required by a bound in `is_send`
note: required by a bound in `is_send`
--> /checkout/tests/ui/async-await/async-await-let-else.rs:16:15
|
LL | fn is_send<T: Send>(_: T) {}
error[E0277]: `Rc<()>` cannot be sent between threads safely
|
|
LL | async fn foo4(x: Option<bool>) {
| ------------------------------ within this `impl Future<Output = ()>`
...
LL | is_send(foo4(Some(true)));
| ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
note: required because it's used within this `async` fn body
|
LL | async fn foo4(x: Option<bool>) {
| ________________________________^
LL | | let Some(_) = x else {
LL | | let Some(_) = x else {
LL | | let r = Rc::new(());
LL | | bar().await;
LL | | };
LL | | }
| |_^
note: required by a bound in `is_send`
note: required by a bound in `is_send`
--> /checkout/tests/ui/async-await/async-await-let-else.rs:16:15
|
LL | fn is_send<T: Send>(_: T) {}
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---- [ui] tests/ui/async-await/async-fn-nonsend.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `Rc<()>` cannot be sent between threads safely
3 |
3 |
+ LL | async fn non_send_temporary_in_match() {
+ | -------------------------------------- within this `impl Future<Output = ()>`
4 LL | assert_send(non_send_temporary_in_match());
4 LL | assert_send(non_send_temporary_in_match());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
+ | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
+ note: required because it appears within the type `impl Debug`
+ --> $DIR/async-fn-nonsend.rs:10:18
10 |
- LL | match Some(non_send()) {
- LL | match Some(non_send()) {
- | ---------------- has type `Option<impl Debug>` which is not `Send`
- LL | Some(_) => fut().await,
- | ^^^^^ await occurs here, with `Some(non_send())` maybe used later
+ LL | fn non_send() -> impl Debug {
+ | ^^^^^^^^^^
+ note: required because it appears within the type `Option<impl Debug>`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ note: required because it's used within this `async` fn body
+ |
+ LL | async fn non_send_temporary_in_match() {
+ | ________________________________________^
+ | ________________________________________^
+ LL | | // We could theoretically make this work as well (produce a `Send` future)
+ LL | | // for scrutinees / temporaries that can or will
+ LL | | // be dropped prior to the match body
+ LL | | }
+ LL | | }
+ | |_^
15 note: required by a bound in `assert_send`
15 note: required by a bound in `assert_send`
16 --> $DIR/async-fn-nonsend.rs:64:24
17 |
18 LL | fn assert_send(_: impl Send) {}
19 | ^^^^ required by this bound in `assert_send`
- error: future cannot be sent between threads safely
+ error[E0277]: `dyn std::fmt::Write` cannot be sent between threads safely
22 --> $DIR/async-fn-nonsend.rs:70:17
23 |
23 |
+ LL | async fn non_sync_with_method_call() {
+ | ------------------------------------ within this `impl Future<Output = ()>`
24 LL | assert_send(non_sync_with_method_call());
24 LL | assert_send(non_sync_with_method_call());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
+ | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn std::fmt::Write` cannot be sent between threads safely
+ | required by a bound introduced by this call
26 |
26 |
27 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
+ = note: required because it appears within the type `&mut dyn std::fmt::Write`
+ note: required because it appears within the type `Formatter<'_>`
+ --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
+ --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
+ note: required because it's used within this `async` fn body
30 |
30 |
- LL | let f: &mut std::fmt::Formatter = &mut get_formatter();
- | --------------- has type `Formatter<'_>` which is not `Send`
- LL | fut().await;
- LL | fut().await;
- | ^^^^^ await occurs here, with `get_formatter()` maybe used later
+ LL | async fn non_sync_with_method_call() {
+ | ______________________________________^
+ LL | | let f: &mut std::fmt::Formatter = &mut get_formatter();
+ LL | | // It would by nice for this to work.
+ LL | | if non_sync().fmt(f).unwrap() == () {
+ LL | | fut().await;
+ LL | | }
+ LL | | }
36 note: required by a bound in `assert_send`
37 --> $DIR/async-fn-nonsend.rs:64:24
38 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/async-fn-nonsend.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/async-await/async-fn-nonsend" "-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/async-await/async-fn-nonsend/auxiliary" "--edition=2018" "--crate-type" "lib"
stdout: none
--- stderr -------------------------------
error[E0277]: `Rc<()>` cannot be sent between threads safely
|
|
LL | async fn non_send_temporary_in_match() {
| -------------------------------------- within this `impl Future<Output = ()>`
LL | assert_send(non_send_temporary_in_match());
LL | assert_send(non_send_temporary_in_match());
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
note: required because it appears within the type `impl Debug`
|
LL | fn non_send() -> impl Debug {
| ^^^^^^^^^^
note: required because it appears within the type `Option<impl Debug>`
note: required because it appears within the type `Option<impl Debug>`
--> /rustc/FAKE_PREFIX/library/core/src/option.rs:571:10
note: required because it's used within this `async` fn body
--> /checkout/tests/ui/async-await/async-fn-nonsend.rs:27:40
|
LL | async fn non_send_temporary_in_match() {
| ________________________________________^
LL | | // We could theoretically make this work as well (produce a `Send` future)
LL | | // for scrutinees / temporaries that can or will
LL | | // be dropped prior to the match body
LL | | }
LL | | }
| |_^
note: required by a bound in `assert_send`
note: required by a bound in `assert_send`
--> /checkout/tests/ui/async-await/async-fn-nonsend.rs:64:24
|
LL | fn assert_send(_: impl Send) {}
| ^^^^ required by this bound in `assert_send`
error[E0277]: `dyn std::fmt::Write` cannot be sent between threads safely
##[error] --> /checkout/tests/ui/async-await/async-fn-nonsend.rs:70:17
|
|
LL | async fn non_sync_with_method_call() {
| ------------------------------------ within this `impl Future<Output = ()>`
LL | assert_send(non_sync_with_method_call());
LL | assert_send(non_sync_with_method_call());
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn std::fmt::Write` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`, which is required by `impl Future<Output = ()>: Send`
note: required because it appears within the type `Formatter<'_>`
--> /rustc/FAKE_PREFIX/library/core/src/fmt/mod.rs:254:12
note: required because it's used within this `async` fn body
--> /checkout/tests/ui/async-await/async-fn-nonsend.rs:42:38
--> /checkout/tests/ui/async-await/async-fn-nonsend.rs:42:38
|
LL | async fn non_sync_with_method_call() {
| ______________________________________^
LL | | let f: &mut std::fmt::Formatter = &mut get_formatter();
LL | | // It would by nice for this to work.
LL | | if non_sync().fmt(f).unwrap() == () {
LL | | fut().await;
LL | | }
| |_^
note: required by a bound in `assert_send`
--> /checkout/tests/ui/async-await/async-fn-nonsend.rs:64:24
--> /checkout/tests/ui/async-await/async-fn-nonsend.rs:64:24
|
LL | fn assert_send(_: impl Send) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/async-await/drop-track-field-assign-nonsend.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `Rc<String>` cannot be sent between threads safely
3 |
+ LL | async fn handle(&mut self) {
+ | -------------------------- within this `impl Future<Output = ()>`
+ ...
+ ...
4 LL | assert_send(agent.handle());
- | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
+ | ----------- ^^^^^^^^^^^^^^ `Rc<String>` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
+ note: required because it appears within the type `Option<Rc<String>>`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ note: required because it appears within the type `InfoResult`
+ --> $DIR/drop-track-field-assign-nonsend.rs:7:8
+ --> $DIR/drop-track-field-assign-nonsend.rs:7:8
10 |
- LL | let mut info = self.info_result.clone();
- | -------- has type `InfoResult` which is not `Send`
- LL | let _ = send_element(element).await;
- LL | let _ = send_element(element).await;
- | ^^^^^ await occurs here, with `mut info` maybe used later
+ LL | struct InfoResult {
+ | ^^^^^^^^^^
+ note: required because it's used within this `async` fn body
+ |
+ LL | async fn handle(&mut self) {
+ | ________________________________^
+ LL | | let mut info = self.info_result.clone();
+ LL | | let mut info = self.info_result.clone();
+ LL | | info.node = None;
+ LL | | let element = parse_info(info);
+ LL | | let _ = send_element(element).await;
+ LL | | }
16 note: required by a bound in `assert_send`
17 --> $DIR/drop-track-field-assign-nonsend.rs:37:19
18 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/drop-track-field-assign-nonsend.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/async-await/drop-track-field-assign-nonsend" "-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/async-await/drop-track-field-assign-nonsend/auxiliary" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0277]: `Rc<String>` cannot be sent between threads safely
|
LL | async fn handle(&mut self) {
| -------------------------- within this `impl Future<Output = ()>`
...
...
LL | assert_send(agent.handle());
| ----------- ^^^^^^^^^^^^^^ `Rc<String>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: Send`
note: required because it appears within the type `Option<Rc<String>>`
note: required because it appears within the type `InfoResult`
--> /checkout/tests/ui/async-await/drop-track-field-assign-nonsend.rs:7:8
|
LL | struct InfoResult {
---
| |_____^
note: required by a bound in `assert_send`
--> /checkout/tests/ui/async-await/drop-track-field-assign-nonsend.rs:37:19
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/async-await/field-assign-nonsend.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `Rc<String>` cannot be sent between threads safely
3 |
+ LL | async fn handle(&mut self) {
+ | -------------------------- within this `impl Future<Output = ()>`
+ ...
+ ...
4 LL | assert_send(agent.handle());
- | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
+ | ----------- ^^^^^^^^^^^^^^ `Rc<String>` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
+ note: required because it appears within the type `Option<Rc<String>>`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ note: required because it appears within the type `InfoResult`
+ --> $DIR/field-assign-nonsend.rs:7:8
+ --> $DIR/field-assign-nonsend.rs:7:8
10 |
- LL | let mut info = self.info_result.clone();
- | -------- has type `InfoResult` which is not `Send`
- LL | let _ = send_element(element).await;
- LL | let _ = send_element(element).await;
- | ^^^^^ await occurs here, with `mut info` maybe used later
+ LL | struct InfoResult {
+ | ^^^^^^^^^^
+ note: required because it's used within this `async` fn body
+ |
+ LL | async fn handle(&mut self) {
+ | ________________________________^
+ LL | | let mut info = self.info_result.clone();
+ LL | | let mut info = self.info_result.clone();
+ LL | | info.node = None;
+ LL | | let element = parse_info(info);
+ LL | | let _ = send_element(element).await;
+ LL | | }
16 note: required by a bound in `assert_send`
17 --> $DIR/field-assign-nonsend.rs:37:19
18 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/field-assign-nonsend.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/async-await/field-assign-nonsend" "-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/async-await/field-assign-nonsend/auxiliary" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0277]: `Rc<String>` cannot be sent between threads safely
|
LL | async fn handle(&mut self) {
| -------------------------- within this `impl Future<Output = ()>`
...
...
LL | assert_send(agent.handle());
| ----------- ^^^^^^^^^^^^^^ `Rc<String>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: Send`
note: required because it appears within the type `Option<Rc<String>>`
note: required because it appears within the type `InfoResult`
--> /checkout/tests/ui/async-await/field-assign-nonsend.rs:7:8
|
LL | struct InfoResult {
---
| |_____^
note: required by a bound in `assert_send`
--> /checkout/tests/ui/async-await/field-assign-nonsend.rs:37:19
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/async-await/in-trait/missing-send-bound.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `impl Future<Output = ()>` cannot be sent between threads safely
3 |
3 |
+ LL | async fn test<T: Foo>() {
+ | ----------------------- within this `impl Future<Output = ()>`
4 LL | assert_is_send(test::<T>());
- | ^^^^^^^^^^^ future returned by `test` is not `Send`
- | ^^^^^^^^^^^ future returned by `test` is not `Send`
+ | -------------- ^^^^^^^^^^^ `impl Future<Output = ()>` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as it awaits another future which is not `Send`
- --> $DIR/missing-send-bound.rs:9:5
+ note: required because it's used within this `async` fn body
10 |
10 |
- LL | T::bar().await;
- | ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
+ LL | async fn test<T: Foo>() {
+ | _________________________^
+ LL | | T::bar().await;
+ LL | | }
13 note: required by a bound in `assert_is_send`
14 --> $DIR/missing-send-bound.rs:17:27
15 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/in-trait/missing-send-bound.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/async-await/in-trait/missing-send-bound" "-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/async-await/in-trait/missing-send-bound/auxiliary" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0277]: `impl Future<Output = ()>` cannot be sent between threads safely
|
|
LL | async fn test<T: Foo>() {
| ----------------------- within this `impl Future<Output = ()>`
LL | assert_is_send(test::<T>());
LL | assert_is_send(test::<T>());
| -------------- ^^^^^^^^^^^ `impl Future<Output = ()>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`, which is required by `impl Future<Output = ()>: Send`
note: required because it's used within this `async` fn body
|
|
LL | async fn test<T: Foo>() {
| _________________________^
LL | | T::bar().await;
| |_^
note: required by a bound in `assert_is_send`
--> /checkout/tests/ui/async-await/in-trait/missing-send-bound.rs:17:27
|
|
LL | fn assert_is_send(_: impl Send) {}
| ^^^^ required by this bound in `assert_is_send`
help: `Send` can be made part of the associated future's guarantees for all implementations of `Foo::bar`
LL - async fn bar();
LL + fn bar() -> impl std::future::Future<Output = ()> + Send;
|
---
3 |
+ LL | async fn bar() {
+ | -------------- within this `impl Future<Output = ()>`
+ ...
4 LL | is_sync(bar());
- | ^^^^^ future returned by `bar` is not `Sync`
+ | ------- ^^^^^ `Foo` cannot be shared between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Sync` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Sync`
- note: future is not `Sync` as this value is used across an await
- --> $DIR/issue-64130-1-sync.rs:15:11
+ note: required because it's used within this `async` fn body
10 |
- LL | let x = Foo;
- | - has type `Foo` which is not `Sync`
- | - has type `Foo` which is not `Sync`
- LL | baz().await;
- | ^^^^^ await occurs here, with `x` maybe used later
+ LL | async fn bar() {
+ LL | | let x = Foo;
+ LL | | let x = Foo;
+ LL | | baz().await;
+ LL | | drop(x);
+ LL | | }
15 note: required by a bound in `is_sync`
16 --> $DIR/issue-64130-1-sync.rs:11:15
17 |
---
|
LL | async fn bar() {
| -------------- within this `impl Future<Output = ()>`
...
LL | is_sync(bar());
| ------- ^^^^^ `Foo` cannot be shared between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Sync` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Sync`
note: required because it's used within this `async` fn body
|
LL | async fn bar() {
| ________________^
LL | | let x = Foo;
LL | | let x = Foo;
LL | | baz().await;
LL | | }
| |_^
note: required by a bound in `is_sync`
--> /checkout/tests/ui/async-await/issue-64130-1-sync.rs:11:15
--> /checkout/tests/ui/async-await/issue-64130-1-sync.rs:11:15
|
LL | fn is_sync<T: Sync>(t: T) { }
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
---
3 |
+ LL | async fn bar() {
+ | -------------- within this `impl Future<Output = ()>`
+ ...
4 LL | is_send(bar());
- | ^^^^^ future returned by `bar` is not `Send`
+ | ------- ^^^^^ `Foo` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
- --> $DIR/issue-64130-2-send.rs:15:11
+ note: required because it's used within this `async` fn body
10 |
- LL | let x = Foo;
- | - has type `Foo` which is not `Send`
- | - has type `Foo` which is not `Send`
- LL | baz().await;
- | ^^^^^ await occurs here, with `x` maybe used later
+ LL | async fn bar() {
+ LL | | let x = Foo;
+ LL | | let x = Foo;
+ LL | | baz().await;
+ LL | | drop(x);
+ LL | | }
15 note: required by a bound in `is_send`
16 --> $DIR/issue-64130-2-send.rs:11:15
17 |
---
|
LL | async fn bar() {
| -------------- within this `impl Future<Output = ()>`
...
LL | is_send(bar());
| ------- ^^^^^ `Foo` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Send`
note: required because it's used within this `async` fn body
|
LL | async fn bar() {
| ________________^
LL | | let x = Foo;
LL | | let x = Foo;
LL | | baz().await;
LL | | }
| |_^
note: required by a bound in `is_send`
--> /checkout/tests/ui/async-await/issue-64130-2-send.rs:11:15
--> /checkout/tests/ui/async-await/issue-64130-2-send.rs:11:15
|
LL | fn is_send<T: Send>(t: T) { }
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
---
diff of stderr:
5 | -------------- within this `impl Future<Output = ()>`
6 ...
7 LL | is_qux(bar());
- | ^^^^^ within `impl Future<Output = ()>`, the trait `Qux` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Qux`
+ | ------ ^^^^^ within `impl Future<Output = ()>`, the trait `Qux` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Qux`
+ | required by a bound introduced by this call
9 |
9 |
- note: future does not implement `Qux` as this value is used across an await
- --> $DIR/issue-64130-3-other.rs:18:11
+ note: required because it's used within this `async` fn body
12 |
- LL | let x = Foo;
- LL | let x = Foo;
- | - has type `Foo` which does not implement `Qux`
- LL | baz().await;
- | ^^^^^ await occurs here, with `x` maybe used later
+ LL | async fn bar() {
+ LL | | let x = Foo;
+ LL | | let x = Foo;
+ LL | | baz().await;
+ LL | | drop(x);
+ LL | | }
17 note: required by a bound in `is_qux`
18 --> $DIR/issue-64130-3-other.rs:14:14
19 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/issue-64130-3-other.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/async-await/issue-64130-3-other" "-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/async-await/issue-64130-3-other/auxiliary" "--edition=2018"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future<Output = ()>`
|
LL | async fn bar() {
| -------------- within this `impl Future<Output = ()>`
...
...
LL | is_qux(bar());
| ------ ^^^^^ within `impl Future<Output = ()>`, the trait `Qux` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Qux`
| required by a bound introduced by this call
|
note: required because it's used within this `async` fn body
--> /checkout/tests/ui/async-await/issue-64130-3-other.rs:16:16
--> /checkout/tests/ui/async-await/issue-64130-3-other.rs:16:16
|
LL | async fn bar() {
| ________________^
LL | | let x = Foo;
LL | | baz().await;
LL | | }
| |_^
note: required by a bound in `is_qux`
--> /checkout/tests/ui/async-await/issue-64130-3-other.rs:14:14
--> /checkout/tests/ui/async-await/issue-64130-3-other.rs:14:14
|
LL | fn is_qux<T: Qux>(t: T) {}
| ^^^ required by this bound in `is_qux`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/async-await/issue-64130-non-send-future-diags.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `MutexGuard<'_, u32>` cannot be sent between threads safely
3 |
+ LL | async fn foo() {
+ | -------------- within this `impl Future<Output = ()>`
+ ...
+ ...
4 LL | is_send(foo());
- | ^^^^^ future returned by `foo` is not `Send`
+ | ------- ^^^^^ `MutexGuard<'_, u32>` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, u32>`, which is required by `impl Future<Output = ()>: Send`
- note: future is not `Send` as this value is used across an await
- --> $DIR/issue-64130-non-send-future-diags.rs:17:11
+ note: required because it's used within this `async` fn body
10 |
10 |
- LL | let g = x.lock().unwrap();
- | - has type `MutexGuard<'_, u32>` which is not `Send`
- LL | baz().await;
- | ^^^^^ await occurs here, with `g` maybe used later
+ LL | async fn bar(x: &Mutex<u32>) {
+ | ______________________________^
+ LL | | let g = x.lock().unwrap();
+ LL | | baz().await;
+ LL | | }
+ | |_^
+ note: required because it's used within this `async` fn body
+ |
+ LL | async fn foo() {
+ | ________________^
+ | ________________^
+ LL | | bar(&Mutex::new(22)).await;
+ LL | | }
15 note: required by a bound in `is_send`
16 --> $DIR/issue-64130-non-send-future-diags.rs:9:15
17 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/issue-64130-non-send-future-diags.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/async-await/issue-64130-non-send-future-diags" "-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/async-await/issue-64130-non-send-future-diags/auxiliary" "--edition=2018"
stdout: none
--- stderr -------------------------------
error[E0277]: `MutexGuard<'_, u32>` cannot be sent between threads safely
|
LL | async fn foo() {
| -------------- within this `impl Future<Output = ()>`
...
...
LL | is_send(foo());
| ------- ^^^^^ `MutexGuard<'_, u32>` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, u32>`, which is required by `impl Future<Output = ()>: Send`
note: required because it's used within this `async` fn body
|
|
LL | async fn bar(x: &Mutex<u32>) {
| ______________________________^
LL | | let g = x.lock().unwrap();
LL | | baz().await;
| |_^
note: required because it's used within this `async` fn body
--> /checkout/tests/ui/async-await/issue-64130-non-send-future-diags.rs:11:16
|
---
| |_^
note: required by a bound in `is_send`
--> /checkout/tests/ui/async-await/issue-64130-non-send-future-diags.rs:9:15
|
LL | fn is_send<T: Send>(t: T) { }
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---- [ui] tests/ui/async-await/issue-67252-unnamed-future.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `*mut ()` cannot be sent between threads safely
3 |
3 |
- LL | / spawn(async {
+ LL | spawn(async {
+ | _____^_____-
+ | ||
+ | ||
+ LL | || let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
+ LL | || AFuture.await;
+ LL | || let _a = a;
+ LL | || });
+ | ||_____-^ `*mut ()` cannot be sent between threads safely
+ | |_____|
+ | within this `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 22:6}`
+ |
+ = help: within `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 22:6}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 22:6}: Send`
+ note: required because it's used within this `async` block
+ |
+ |
+ LL | spawn(async {
+ | ___________^
5 LL | | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
6 LL | | AFuture.await;
7 LL | | let _a = a;
8 LL | | });
8 LL | | });
- | |______^ future created by async block is not `Send`
- |
- = help: within `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 22:6}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 22:6}: Send`
- note: future is not `Send` as this value is used across an await
- |
- |
- LL | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
- | - has type `*mut ()` which is not `Send`
- LL | AFuture.await;
- | ^^^^^ await occurs here, with `a` maybe used later
19 note: required by a bound in `spawn`
20 --> $DIR/issue-67252-unnamed-future.rs:6:13
21 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/issue-67252-unnamed-future.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/async-await/issue-67252-unnamed-future" "-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/async-await/issue-67252-unnamed-future/auxiliary" "--edition=2018"
stdout: none
--- stderr -------------------------------
error[E0277]: `*mut ()` cannot be sent between threads safely
|
|
LL | spawn(async { //~ ERROR future cannot be sent between threads safely
| _____^_____-
| ||
| ||
LL | || let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
LL | || AFuture.await;
LL | || let _a = a;
LL | || });
| ||_____-^ `*mut ()` cannot be sent between threads safely
| |_____|
| within this `{async block@/checkout/tests/ui/async-await/issue-67252-unnamed-future.rs:18:11: 22:6}`
|
= help: within `{async block@/checkout/tests/ui/async-await/issue-67252-unnamed-future.rs:18:11: 22:6}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{async block@/checkout/tests/ui/async-await/issue-67252-unnamed-future.rs:18:11: 22:6}: Send`
note: required because it's used within this `async` block
|
|
LL | spawn(async { //~ ERROR future cannot be sent between threads safely
| ___________^
LL | | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
LL | | AFuture.await;
LL | | let _a = a;
| |_____^
note: required by a bound in `spawn`
--> /checkout/tests/ui/async-await/issue-67252-unnamed-future.rs:6:13
|
|
LL | fn spawn<T: Send>(_: T) {}
| ^^^^ required by this bound in `spawn`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/async-await/issue-68112.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `RefCell<i32>` cannot be shared between threads safely
3 |
4 LL | require_send(send_fut);
- | ^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
+ | ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
6 |
7 = help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@$DIR/issue-68112.rs:29:20: 33:6}: Send`
8 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
- note: future is not `Send` as it awaits another future which is not `Send`
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
+ note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
11 |
11 |
- LL | let _ = non_send_fut.await;
- | ^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
+ LL | struct Ready<T>(Option<T>);
+ | ^^^^^
+ note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
+ |
+ |
+ LL | fn make_non_send_future1() -> impl Future<Output = Arc<RefCell<i32>>> {
+ note: required because it's used within this `async` block
+ --> $DIR/issue-68112.rs:29:20
+ |
+ LL | let send_fut = async {
+ LL | let send_fut = async {
+ | ____________________^
+ LL | | let non_send_fut = make_non_send_future1();
+ LL | | let _ = non_send_fut.await;
+ LL | | ready(0).await;
+ LL | | };
14 note: required by a bound in `require_send`
15 --> $DIR/issue-68112.rs:11:25
16 |
17 LL | fn require_send(_: impl Send) {}
19
- error: future cannot be sent between threads safely
- error: future cannot be sent between threads safely
+ error[E0277]: `RefCell<i32>` cannot be shared between threads safely
22 |
23 LL | require_send(send_fut);
- | ^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
+ | ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
25 |
26 = help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@$DIR/issue-68112.rs:39:20: 42:6}: Send`
27 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
- note: future is not `Send` as it awaits another future which is not `Send`
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
+ note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
30 |
30 |
- LL | let _ = make_non_send_future1().await;
- | ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
+ LL | struct Ready<T>(Option<T>);
+ | ^^^^^
+ note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
+ |
+ |
+ LL | fn make_non_send_future1() -> impl Future<Output = Arc<RefCell<i32>>> {
+ note: required because it's used within this `async` block
+ --> $DIR/issue-68112.rs:39:20
+ |
+ LL | let send_fut = async {
+ LL | let send_fut = async {
+ | ____________________^
+ LL | | let _ = make_non_send_future1().await;
+ LL | | ready(0).await;
+ LL | | };
33 note: required by a bound in `require_send`
34 --> $DIR/issue-68112.rs:11:25
35 |
---
To only update this specific test, also pass `--test-args async-await/issue-68112.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/issue-68112.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/async-await/issue-68112" "-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/async-await/issue-68112/auxiliary" "--edition=2018"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
|
LL | require_send(send_fut);
LL | require_send(send_fut);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@/checkout/tests/ui/async-await/issue-68112.rs:29:20: 33:6}: Send`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
--> /rustc/FAKE_PREFIX/library/core/src/option.rs:571:10
note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
|
|
LL | struct Ready<T>(Option<T>);
note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
--> /checkout/tests/ui/async-await/issue-68112.rs:24:31
|
|
LL | fn make_non_send_future1() -> impl Future<Output = Arc<RefCell<i32>>> {
note: required because it's used within this `async` block
--> /checkout/tests/ui/async-await/issue-68112.rs:29:20
|
LL | let send_fut = async {
LL | let send_fut = async {
| ____________________^
LL | | let non_send_fut = make_non_send_future1();
LL | | let _ = non_send_fut.await;
LL | | ready(0).await;
| |_____^
note: required by a bound in `require_send`
--> /checkout/tests/ui/async-await/issue-68112.rs:11:25
|
|
LL | fn require_send(_: impl Send) {}
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
|
LL | require_send(send_fut);
LL | require_send(send_fut);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@/checkout/tests/ui/async-await/issue-68112.rs:39:20: 42:6}: Send`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
--> /rustc/FAKE_PREFIX/library/core/src/option.rs:571:10
note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
|
|
LL | struct Ready<T>(Option<T>);
note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
--> /checkout/tests/ui/async-await/issue-68112.rs:24:31
|
|
LL | fn make_non_send_future1() -> impl Future<Output = Arc<RefCell<i32>>> {
note: required because it's used within this `async` block
--> /checkout/tests/ui/async-await/issue-68112.rs:39:20
|
LL | let send_fut = async {
LL | let send_fut = async {
| ____________________^
LL | | let _ = make_non_send_future1().await;
LL | | ready(0).await;
| |_____^
note: required by a bound in `require_send`
--> /checkout/tests/ui/async-await/issue-68112.rs:11:25
|
|
LL | fn require_send(_: impl Send) {}
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
|
LL | require_send(send_fut);
LL | require_send(send_fut);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@/checkout/tests/ui/async-await/issue-68112.rs:57:20: 61:6}: Send`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it's used within this `async` fn body
|
LL | async fn ready2<T>(t: T) -> T {
| _______________________________^
LL | | t
LL | | t
LL | | }
| |_^
note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
--> /checkout/tests/ui/async-await/issue-68112.rs:50:31
|
LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
note: required because it's used within this `async` block
--> /checkout/tests/ui/async-await/issue-68112.rs:57:20
|
LL | let send_fut = async {
LL | let send_fut = async {
| ____________________^
LL | | let non_send_fut = make_non_send_future2();
LL | | let _ = non_send_fut.await;
LL | | ready(0).await;
| |_____^
note: required by a bound in `require_send`
--> /checkout/tests/ui/async-await/issue-68112.rs:11:25
|
|
LL | fn require_send(_: impl Send) {}
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---- [ui] tests/ui/async-await/issue-86507.rs stdout ----
diff of stderr:
31 LL | | )
32 | |_____________^ future created by async block is not `Send`
33 |
- note: future is not `Send` as this value is used across an await
- --> $DIR/issue-86507.rs:19:17
+ note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
36 |
- LL | async move {
- | ^
- | |
- | |
- | _________________await occurs here, with the value maybe used later
- LL | | let x = x;
- LL | | }
- LL | | }
- | |_________________- has type `&T` which is not `Send`
+ LL | let x = x;
+ | ^ has type `&T` which is not `Send`, because `T` is not `Sync`
45 = note: required for the cast from `Pin<Box<{async block@$DIR/issue-86507.rs:19:17: 21:18}>>` to `Pin<Box<dyn Future<Output = ()> + Send>>`
47 |
The actual stderr differed from the expected stderr.
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-86507/issue-86507.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-86507.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/issue-86507.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/async-await/issue-86507" "-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/async-await/issue-86507/auxiliary" "--edition=2018"
--- stderr -------------------------------
error: future cannot be sent between threads safely
##[error] --> /checkout/tests/ui/async-await/issue-86507.rs:17:13
|
|
LL | / Box::pin( //~ ERROR future cannot be sent between threads safely
LL | | //~^ ERROR future cannot be sent between threads safely
LL | | async move {
LL | | }
LL | | )
LL | | )
| |_____________^ future created by async block is not `Send`
|
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
|
LL | let x = x;
LL | let x = x;
| ^ has type `&T` which is not `Send`, because `T` is not `Sync`
= note: required for the cast from `Pin<Box<{async block@/checkout/tests/ui/async-await/issue-86507.rs:19:17: 21:18}>>` to `Pin<Box<(dyn Future<Output = ()> + Send + 'async_trait)>>`
|
|
LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T)
error: future cannot be sent between threads safely
##[error] --> /checkout/tests/ui/async-await/issue-86507.rs:17:13
|
|
LL | / Box::pin( //~ ERROR future cannot be sent between threads safely
LL | | //~^ ERROR future cannot be sent between threads safely
LL | | async move {
LL | | }
LL | | )
LL | | )
| |_____________^ future created by async block is not `Send`
|
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
|
LL | let x = x;
LL | let x = x;
| ^ has type `&T` which is not `Send`, because `T` is not `Sync`
= note: required for the cast from `Pin<Box<{async block@/checkout/tests/ui/async-await/issue-86507.rs:19:17: 21:18}>>` to `Pin<Box<dyn Future<Output = ()> + Send>>`
|
|
LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T)
error: aborting due to 2 previous errors
------------------------------------------
---- [ui] tests/ui/coroutine/clone-impl.rs stdout ----
diff of stderr:
8 | ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:36:23: 36:30}`, the trait `Copy` is not implemented for `Vec<u32>`, which is required by `{coroutine@$DIR/clone-impl.rs:36:23: 36:30}: Copy`
9 |
10 note: coroutine does not implement `Copy` as this value is used across a yield
+ --> $DIR/clone-impl.rs:38:9
12 |
13 LL | let gen_clone_0 = move || {
- | ^
- | ^
- | |
- | _______________________yield occurs here, with the value maybe used later
+ | _______________________-
+ | _______________________-
18 LL | | let v = vec!['a'];
19 LL | | yield;
+ | | ^^^^^ yield occurs here, with the value maybe used later
20 LL | | drop(v);
21 LL | | drop(clonable_0);
36 LL | check_copy(&gen_clone_0);
37 | ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:36:23: 36:30}`, the trait `Copy` is not implemented for `Vec<char>`, which is required by `{coroutine@$DIR/clone-impl.rs:36:23: 36:30}: Copy`
38 |
- note: coroutine does not implement `Copy` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/clone-impl.rs:36:23
41 |
41 |
- LL | let v = vec!['a'];
- | - has type `Vec<char>` which does not implement `Copy`
- LL | yield;
- | ^^^^^ yield occurs here, with `v` maybe used later
+ LL | let gen_clone_0 = move || {
46 note: required by a bound in `check_copy`
47 --> $DIR/clone-impl.rs:72:18
48 |
59 | ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:46:23: 46:30}`, the trait `Copy` is not implemented for `Vec<u32>`, which is required by `{coroutine@$DIR/clone-impl.rs:46:23: 46:30}: Copy`
60 |
61 note: coroutine does not implement `Copy` as this value is used across a yield
+ --> $DIR/clone-impl.rs:52:9
63 |
64 LL | let gen_clone_1 = move || {
- | ^
- | ^
- | |
- | _______________________yield occurs here, with the value maybe used later
+ | _______________________-
+ | _______________________-
69 LL | | let v = vec!['a'];
71 LL | | let n = NonClone;
72 ... |
+ LL | | yield;
+ LL | | yield;
+ | | ^^^^^ yield occurs here, with the value maybe used later
+ ... |
73 LL | | drop(clonable_1);
74 LL | | };
75 | |_____- has type `Vec<u32>` which does not implement `Copy`
88 LL | check_copy(&gen_clone_1);
89 | ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:46:23: 46:30}`, the trait `Copy` is not implemented for `Vec<char>`, which is required by `{coroutine@$DIR/clone-impl.rs:46:23: 46:30}: Copy`
90 |
- note: coroutine does not implement `Copy` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/clone-impl.rs:46:23
93 |
93 |
- LL | let v = vec!['a'];
- | - has type `Vec<char>` which does not implement `Copy`
- LL | yield;
- LL | yield;
- | ^^^^^ yield occurs here, with `v` maybe used later
+ LL | let gen_clone_1 = move || {
99 note: required by a bound in `check_copy`
100 --> $DIR/clone-impl.rs:72:18
101 |
111 LL | check_copy(&gen_non_clone);
112 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:62:25: 62:32}`, the trait `Copy` is not implemented for `NonClone`, which is required by `{coroutine@$DIR/clone-impl.rs:62:25: 62:32}: Copy`
113 |
- note: coroutine does not implement `Copy` as this value is used across a yield
+ note: captured value does not implement `Copy`
+ --> $DIR/clone-impl.rs:64:14
116 |
- LL | let gen_non_clone = move || {
- LL | let gen_non_clone = move || {
- | ^
- | |
- | _________________________yield occurs here, with the value maybe used later
- LL | | yield;
- LL | | drop(non_clonable);
- LL | | };
- | |_____- has type `NonClone` which does not implement `Copy`
- | |_____- has type `NonClone` which does not implement `Copy`
+ LL | drop(non_clonable);
+ | ^^^^^^^^^^^^ has type `NonClone` which does not implement `Copy`
126 note: required by a bound in `check_copy`
128 |
143 LL | check_clone(&gen_non_clone);
144 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:62:25: 62:32}`, the trait `Clone` is not implemented for `NonClone`, which is required by `{coroutine@$DIR/clone-impl.rs:62:25: 62:32}: Clone`
145 |
- note: coroutine does not implement `Clone` as this value is used across a yield
+ note: captured value does not implement `Clone`
+ --> $DIR/clone-impl.rs:64:14
148 |
- LL | let gen_non_clone = move || {
- LL | let gen_non_clone = move || {
- | ^
- | |
- | _________________________yield occurs here, with the value maybe used later
- LL | | yield;
- LL | | drop(non_clonable);
- LL | | };
- | |_____- has type `NonClone` which does not implement `Clone`
- | |_____- has type `NonClone` which does not implement `Clone`
+ LL | drop(non_clonable);
+ | ^^^^^^^^^^^^ has type `NonClone` which does not implement `Clone`
158 note: required by a bound in `check_clone`
160 |
The actual stderr differed from the expected stderr.
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/clone-impl.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/coroutine/clone-impl" "-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/coroutine/clone-impl/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}`
|
LL | let gen_clone_0 = move || {
LL | let gen_clone_0 = move || {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}`
...
LL | check_copy(&gen_clone_0);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}`, the trait `Copy` is not implemented for `Vec<u32>`, which is required by `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}: Copy`
|
note: coroutine does not implement `Copy` as this value is used across a yield
|
LL | let gen_clone_0 = move || {
| _______________________-
| _______________________-
LL | | let v = vec!['a'];
LL | | yield;
| | ^^^^^ yield occurs here, with the value maybe used later
LL | | drop(v);
LL | | drop(clonable_0);
LL | | };
| |_____- has type `Vec<u32>` which does not implement `Copy`
note: required by a bound in `check_copy`
|
|
LL | fn check_copy<T: Copy>(_x: &T) {}
| ^^^^ required by this bound in `check_copy`
error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}`
|
LL | let gen_clone_0 = move || {
LL | let gen_clone_0 = move || {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}`
...
LL | check_copy(&gen_clone_0);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}`, the trait `Copy` is not implemented for `Vec<char>`, which is required by `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:36:23: 36:30}: Copy`
note: required because it's used within this coroutine
--> /checkout/tests/ui/coroutine/clone-impl.rs:36:23
|
LL | let gen_clone_0 = move || {
LL | let gen_clone_0 = move || {
| ^^^^^^^
note: required by a bound in `check_copy`
--> /checkout/tests/ui/coroutine/clone-impl.rs:72:18
|
LL | fn check_copy<T: Copy>(_x: &T) {}
| ^^^^ required by this bound in `check_copy`
error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}`
|
LL | let gen_clone_1 = move || {
LL | let gen_clone_1 = move || {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}`
...
LL | check_copy(&gen_clone_1);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}`, the trait `Copy` is not implemented for `Vec<u32>`, which is required by `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}: Copy`
|
note: coroutine does not implement `Copy` as this value is used across a yield
|
LL | let gen_clone_1 = move || {
| _______________________-
| _______________________-
LL | | let v = vec!['a'];
LL | | let n = NonClone;
... |
LL | | yield;
LL | | yield;
| | ^^^^^ yield occurs here, with the value maybe used later
... |
LL | | drop(clonable_1);
LL | | };
| |_____- has type `Vec<u32>` which does not implement `Copy`
note: required by a bound in `check_copy`
|
|
LL | fn check_copy<T: Copy>(_x: &T) {}
| ^^^^ required by this bound in `check_copy`
error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}`
|
LL | let gen_clone_1 = move || {
LL | let gen_clone_1 = move || {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}`
...
LL | check_copy(&gen_clone_1);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}`, the trait `Copy` is not implemented for `Vec<char>`, which is required by `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:46:23: 46:30}: Copy`
note: required because it's used within this coroutine
--> /checkout/tests/ui/coroutine/clone-impl.rs:46:23
|
LL | let gen_clone_1 = move || {
LL | let gen_clone_1 = move || {
| ^^^^^^^
note: required by a bound in `check_copy`
--> /checkout/tests/ui/coroutine/clone-impl.rs:72:18
|
LL | fn check_copy<T: Copy>(_x: &T) {}
| ^^^^ required by this bound in `check_copy`
error[E0277]: the trait bound `NonClone: Copy` is not satisfied in `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}`
|
LL | let gen_non_clone = move || {
LL | let gen_non_clone = move || {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}`
...
LL | check_copy(&gen_non_clone);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}`, the trait `Copy` is not implemented for `NonClone`, which is required by `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}: Copy`
note: captured value does not implement `Copy`
--> /checkout/tests/ui/coroutine/clone-impl.rs:64:14
|
LL | drop(non_clonable);
LL | drop(non_clonable);
| ^^^^^^^^^^^^ has type `NonClone` which does not implement `Copy`
note: required by a bound in `check_copy`
--> /checkout/tests/ui/coroutine/clone-impl.rs:72:18
|
LL | fn check_copy<T: Copy>(_x: &T) {}
| ^^^^ required by this bound in `check_copy`
help: consider annotating `NonClone` with `#[derive(Copy)]`
LL + #[derive(Copy)]
LL | struct NonClone;
|
error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}`
|
LL | let gen_non_clone = move || {
LL | let gen_non_clone = move || {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}`
...
LL | check_clone(&gen_non_clone);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}`, the trait `Clone` is not implemented for `NonClone`, which is required by `{coroutine@/checkout/tests/ui/coroutine/clone-impl.rs:62:25: 62:32}: Clone`
note: captured value does not implement `Clone`
--> /checkout/tests/ui/coroutine/clone-impl.rs:64:14
|
LL | drop(non_clonable);
LL | drop(non_clonable);
| ^^^^^^^^^^^^ has type `NonClone` which does not implement `Clone`
note: required by a bound in `check_clone`
--> /checkout/tests/ui/coroutine/clone-impl.rs:73:19
|
LL | fn check_clone<T: Clone>(_x: &T) {}
| ^^^^^ required by this bound in `check_clone`
help: consider annotating `NonClone` with `#[derive(Clone)]`
LL + #[derive(Clone)]
LL | struct NonClone;
|
---
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `derived_drop::Client` cannot be sent between threads safely
2 --> $DIR/drop-tracking-parent-expression.rs:23:13
3 |
+ LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
+ | ------- within this `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}`
4 LL | assert_send(g);
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^ `derived_drop::Client` cannot be sent between threads safely
6 ...
6 ...
7 LL | / type_combinations!(
8 LL | | // OK
14 | |_____- in this macro invocation
15 |
16 = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `derived_drop::Client`, which is required by `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/drop-tracking-parent-expression.rs:17:21
19 |
19 |
20 LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
- | ------------------------ has type `derived_drop::Client` which is not `Send`
22 ...
- LL | _ => yield,
- LL | _ => yield,
- | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later
26 LL | / type_combinations!(
27 LL | | // OK
27 LL | | // OK
28 LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
38 | ^^^^ required by this bound in `assert_send`
39 = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
40
- error: coroutine cannot be sent between threads safely
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `significant_drop::Client` cannot be sent between threads safely
42 --> $DIR/drop-tracking-parent-expression.rs:23:13
43 |
+ LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
+ | ------- within this `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}`
44 LL | assert_send(g);
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^ `significant_drop::Client` cannot be sent between threads safely
46 ...
46 ...
47 LL | / type_combinations!(
48 LL | | // OK
54 | |_____- in this macro invocation
55 |
56 = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `significant_drop::Client`, which is required by `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/drop-tracking-parent-expression.rs:17:21
59 |
59 |
60 LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
- | ------------------------ has type `significant_drop::Client` which is not `Send`
62 ...
- LL | _ => yield,
- LL | _ => yield,
- | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later
66 LL | / type_combinations!(
67 LL | | // OK
67 LL | | // OK
68 LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
78 | ^^^^ required by this bound in `assert_send`
79 = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
80
- error: coroutine cannot be sent between threads safely
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `insignificant_dtor::Client` cannot be sent between threads safely
83 |
83 |
+ LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
+ | ------- within this `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}`
84 LL | assert_send(g);
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^ `insignificant_dtor::Client` cannot be sent between threads safely
87 LL | / type_combinations!(
88 LL | | // OK
94 | |_____- in this macro invocation
94 | |_____- in this macro invocation
95 |
96 = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client`, which is required by `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:21: 17:28}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/drop-tracking-parent-expression.rs:17:21
99 |
99 |
100 LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
- | ------------------------ has type `insignificant_dtor::Client` which is not `Send`
102 ...
- LL | _ => yield,
- LL | _ => yield,
- | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later
106 LL | / type_combinations!(
107 LL | | // OK
107 LL | | // OK
108 LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
120
121 error: aborting due to 3 previous errors
122
+ For more information about this error, try `rustc --explain E0277`.
---
--- stderr -------------------------------
error[E0277]: `derived_drop::Client` cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:23:13
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}`
LL | assert_send(g);
| ^^^^^^^^^^^^^^ `derived_drop::Client` cannot be sent between threads safely
...
LL | / type_combinations!(
LL | / type_combinations!(
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `derived_drop::Client`, which is required by `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}: Send`
--> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
...
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:40:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `significant_drop::Client` cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:23:13
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}`
LL | assert_send(g);
| ^^^^^^^^^^^^^^ `significant_drop::Client` cannot be sent between threads safely
...
LL | / type_combinations!(
LL | / type_combinations!(
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `significant_drop::Client`, which is required by `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}: Send`
--> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
...
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:40:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `insignificant_dtor::Client` cannot be sent between threads safely
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}`
LL | assert_send(g);
LL | assert_send(g);
| ^^^^^^^^^^^^^^ `insignificant_dtor::Client` cannot be sent between threads safely
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client`, which is required by `{coroutine@/checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21: 17:28}: Send`
--> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:17:21
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
...
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/drop-tracking-parent-expression.rs:40:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `Foo` cannot be sent between threads safely
2 --> $DIR/drop-yield-twice.rs:7:5
3 |
- LL | / assert_send(|| {
+ LL | assert_send(|| {
+ | ^ -- within this `{coroutine@$DIR/drop-yield-twice.rs:7:17: 7:19}`
+ | |
5 LL | | let guard = Foo(42);
6 LL | | yield;
7 LL | | drop(guard);
7 LL | | drop(guard);
8 LL | | yield;
9 LL | | })
- | |______^ coroutine is not `Send`
+ | |______^ `Foo` cannot be sent between threads safely
11 |
12 = help: within `{coroutine@$DIR/drop-yield-twice.rs:7:17: 7:19}`, the trait `Send` is not implemented for `Foo`, which is required by `{coroutine@$DIR/drop-yield-twice.rs:7:17: 7:19}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/drop-yield-twice.rs:7:17
15 |
- LL | let guard = Foo(42);
- LL | let guard = Foo(42);
- | ----- has type `Foo` which is not `Send`
- LL | yield;
- | ^^^^^ yield occurs here, with `guard` maybe used later
+ LL | assert_send(|| {
20 note: required by a bound in `assert_send`
21 --> $DIR/drop-yield-twice.rs:15:19
22 |
---
--- stderr -------------------------------
error[E0277]: `Foo` cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/drop-yield-twice.rs:7:5
|
LL | assert_send(|| { //~ ERROR coroutine cannot be sent between threads safely
| ^ -- within this `{coroutine@/checkout/tests/ui/coroutine/drop-yield-twice.rs:7:17: 7:19}`
| |
LL | | let guard = Foo(42);
LL | | yield;
LL | | drop(guard);
LL | | drop(guard);
LL | | yield;
LL | | })
| |______^ `Foo` cannot be sent between threads safely
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/drop-yield-twice.rs:7:17: 7:19}`, the trait `Send` is not implemented for `Foo`, which is required by `{coroutine@/checkout/tests/ui/coroutine/drop-yield-twice.rs:7:17: 7:19}: Send`
--> /checkout/tests/ui/coroutine/drop-yield-twice.rs:7:17
|
|
LL | assert_send(|| { //~ ERROR coroutine cannot be sent between threads safely
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/drop-yield-twice.rs:15:19
|
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/coroutine/issue-105084.rs stdout ----
diff of stderr:
31 LL | let mut h = copy(g);
32 | ^^^^^^^ within `{coroutine@$DIR/issue-105084.rs:14:17: 14:19}`, the trait `Copy` is not implemented for `Box<(i32, ())>`, which is required by `{coroutine@$DIR/issue-105084.rs:14:17: 14:19}: Copy`
33 |
- note: coroutine does not implement `Copy` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/issue-105084.rs:14:17
36 |
36 |
- LL | Box::new((5, yield));
- | | |
- | | |
- | | yield occurs here, with `Box::new((5, yield))` maybe used later
- | has type `Box<(i32, ())>` which does not implement `Copy`
+ LL | let mut g = || {
42 note: required by a bound in `copy`
43 --> $DIR/issue-105084.rs:9:12
44 |
---
To only update this specific test, also pass `--test-args coroutine/issue-105084.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/issue-105084.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/coroutine/issue-105084" "-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/coroutine/issue-105084/auxiliary"
--- stderr -------------------------------
error[E0382]: borrow of moved value: `g`
##[error] --> /checkout/tests/ui/coroutine/issue-105084.rs:37:14
|
|
LL | let mut g = || {
| ----- move occurs because `g` has type `{coroutine@/checkout/tests/ui/coroutine/issue-105084.rs:14:17: 14:19}`, which does not implement the `Copy` trait
...
LL | let mut h = copy(g);
...
...
LL | Pin::new(&mut g).resume(());
|
|
note: consider changing this parameter type in function `copy` to borrow instead if owning the value isn't necessary
|
|
LL | fn copy<T: Copy>(x: T) -> T {
| ---- ^ this parameter takes ownership of the value
| in this function
help: consider cloning the value if the performance cost is acceptable
|
|
LL | let mut h = copy(g.clone());
error[E0277]: the trait bound `Box<(i32, ())>: Copy` is not satisfied in `{coroutine@/checkout/tests/ui/coroutine/issue-105084.rs:14:17: 14:19}`
|
|
LL | let mut g = || {
| -- within this `{coroutine@/checkout/tests/ui/coroutine/issue-105084.rs:14:17: 14:19}`
...
LL | let mut h = copy(g);
| ^^^^^^^ within `{coroutine@/checkout/tests/ui/coroutine/issue-105084.rs:14:17: 14:19}`, the trait `Copy` is not implemented for `Box<(i32, ())>`, which is required by `{coroutine@/checkout/tests/ui/coroutine/issue-105084.rs:14:17: 14:19}: Copy`
note: required because it's used within this coroutine
--> /checkout/tests/ui/coroutine/issue-105084.rs:14:17
|
|
LL | let mut g = || {
note: required by a bound in `copy`
--> /checkout/tests/ui/coroutine/issue-105084.rs:9:12
|
|
LL | fn copy<T: Copy>(x: T) -> T {
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0382.
Some errors have detailed explanations: E0277, E0382.
For more information about an error, try `rustc --explain E0277`.
------------------------------------------
---- [ui] tests/ui/coroutine/issue-68112.rs stdout ----
diff of stderr:
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `RefCell<i32>` cannot be shared between threads safely
3 |
4 LL | require_send(send_gen);
- | ^^^^^^^^^^^^^^^^^^^^^^ coroutine is not `Send`
- | ^^^^^^^^^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
6 |
7 = help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{coroutine@$DIR/issue-68112.rs:33:20: 33:22}: Send`
8 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
- note: coroutine is not `Send` as this value is used across a yield
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
+ note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
11 |
11 |
- LL | let _non_send_gen = make_non_send_coroutine();
- | ------------- has type `impl Coroutine<Return = Arc<RefCell<i32>>>` which is not `Send`
- LL | yield;
- LL | yield;
- | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
+ LL | pub struct Ready<T>(Option<T>);
+ | ^^^^^
+ note: required because it appears within the type `impl Coroutine<Return = Arc<RefCell<i32>>>`
+ |
+ |
+ LL | fn make_non_send_coroutine() -> impl Coroutine<Return = Arc<RefCell<i32>>> {
+ note: required because it's used within this coroutine
+ --> $DIR/issue-68112.rs:33:20
+ |
+ |
+ LL | let send_gen = || {
17 note: required by a bound in `require_send`
18 --> $DIR/issue-68112.rs:22:25
19 |
---
To only update this specific test, also pass `--test-args coroutine/issue-68112.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/issue-68112.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/coroutine/issue-68112" "-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/coroutine/issue-68112/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
|
LL | require_send(send_gen);
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{coroutine@/checkout/tests/ui/coroutine/issue-68112.rs:33:20: 33:22}: Send`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
--> /rustc/FAKE_PREFIX/library/core/src/option.rs:571:10
note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
|
|
LL | pub struct Ready<T>(Option<T>);
| ^^^^^
note: required because it appears within the type `impl Coroutine<Return = Arc<RefCell<i32>>>`
|
|
LL | fn make_non_send_coroutine() -> impl Coroutine<Return = Arc<RefCell<i32>>> {
note: required because it's used within this coroutine
--> /checkout/tests/ui/coroutine/issue-68112.rs:33:20
|
|
LL | let send_gen = || {
note: required by a bound in `require_send`
--> /checkout/tests/ui/coroutine/issue-68112.rs:22:25
|
|
LL | fn require_send(_: impl Send) {}
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
|
LL | require_send(send_gen);
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{coroutine@/checkout/tests/ui/coroutine/issue-68112.rs:60:20: 60:22}: Send`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
--> /checkout/tests/ui/coroutine/issue-68112.rs:49:5
|
|
LL | || { //~ NOTE used within this coroutine
| ^^
note: required because it appears within the type `impl Coroutine<Return = Arc<RefCell<i32>>>`
|
|
LL | pub fn make_gen2<T>(t: T) -> impl Coroutine<Return = T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `impl Coroutine<Return = Arc<RefCell<i32>>>`
|
|
LL | fn make_non_send_coroutine2() -> impl Coroutine<Return = Arc<RefCell<i32>>> { //~ NOTE appears within the type
note: required because it's used within this coroutine
--> /checkout/tests/ui/coroutine/issue-68112.rs:60:20
|
|
LL | let send_gen = || { //~ NOTE used within this coroutine
note: required by a bound in `require_send`
--> /checkout/tests/ui/coroutine/issue-68112.rs:22:25
|
|
LL | fn require_send(_: impl Send) {}
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---- [ui] tests/ui/coroutine/not-send-sync.rs stdout ----
diff of stderr:
- error: coroutine cannot be shared between threads safely
+ error[E0277]: `NotSync` cannot be shared between threads safely
3 |
- LL | / assert_sync(|| {
+ LL | assert_sync(|| {
+ LL | assert_sync(|| {
+ | ^ -- within this `{coroutine@$DIR/not-send-sync.rs:14:17: 14:19}`
+ | |
5 LL | |
6 LL | | let a = NotSync;
7 LL | | yield;
7 LL | | yield;
8 LL | | drop(a);
9 LL | | });
- | |______^ coroutine is not `Sync`
+ | |______^ `NotSync` cannot be shared between threads safely
11 |
12 = help: within `{coroutine@$DIR/not-send-sync.rs:14:17: 14:19}`, the trait `Sync` is not implemented for `NotSync`, which is required by `{coroutine@$DIR/not-send-sync.rs:14:17: 14:19}: Sync`
- note: coroutine is not `Sync` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/not-send-sync.rs:14:17
15 |
- LL | let a = NotSync;
- LL | let a = NotSync;
- | - has type `NotSync` which is not `Sync`
- LL | yield;
- | ^^^^^ yield occurs here, with `a` maybe used later
+ LL | assert_sync(|| {
20 note: required by a bound in `assert_sync`
21 --> $DIR/not-send-sync.rs:11:23
22 |
23 LL | fn assert_sync<T: Sync>(_: T) {}
24 | ^^^^ required by this bound in `assert_sync`
- error: coroutine cannot be sent between threads safely
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `NotSend` cannot be sent between threads safely
28 |
- LL | / assert_send(|| {
+ LL | assert_send(|| {
+ LL | assert_send(|| {
+ | ^ -- within this `{coroutine@$DIR/not-send-sync.rs:21:17: 21:19}`
+ | |
30 LL | |
31 LL | | let a = NotSend;
32 LL | | yield;
32 LL | | yield;
33 LL | | drop(a);
34 LL | | });
- | |______^ coroutine is not `Send`
+ | |______^ `NotSend` cannot be sent between threads safely
36 |
37 = help: within `{coroutine@$DIR/not-send-sync.rs:21:17: 21:19}`, the trait `Send` is not implemented for `NotSend`, which is required by `{coroutine@$DIR/not-send-sync.rs:21:17: 21:19}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/not-send-sync.rs:21:17
40 |
- LL | let a = NotSend;
- LL | let a = NotSend;
- | - has type `NotSend` which is not `Send`
- LL | yield;
- | ^^^^^ yield occurs here, with `a` maybe used later
+ LL | assert_send(|| {
45 note: required by a bound in `assert_send`
46 --> $DIR/not-send-sync.rs:12:23
47 |
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/not-send-sync.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/coroutine/not-send-sync" "-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/coroutine/not-send-sync/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: `NotSync` cannot be shared between threads safely
|
LL | assert_sync(|| {
LL | assert_sync(|| {
| ^ -- within this `{coroutine@/checkout/tests/ui/coroutine/not-send-sync.rs:14:17: 14:19}`
| |
| |
LL | | //~^ ERROR: coroutine cannot be shared between threads safely
LL | | let a = NotSync;
LL | | drop(a);
LL | | });
LL | | });
| |______^ `NotSync` cannot be shared between threads safely
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/not-send-sync.rs:14:17: 14:19}`, the trait `Sync` is not implemented for `NotSync`, which is required by `{coroutine@/checkout/tests/ui/coroutine/not-send-sync.rs:14:17: 14:19}: Sync`
--> /checkout/tests/ui/coroutine/not-send-sync.rs:14:17
|
LL | assert_sync(|| {
| ^^
| ^^
note: required by a bound in `assert_sync`
--> /checkout/tests/ui/coroutine/not-send-sync.rs:11:23
|
LL | fn assert_sync<T: Sync>(_: T) {}
| ^^^^ required by this bound in `assert_sync`
error[E0277]: `NotSend` cannot be sent between threads safely
|
LL | assert_send(|| {
LL | assert_send(|| {
| ^ -- within this `{coroutine@/checkout/tests/ui/coroutine/not-send-sync.rs:21:17: 21:19}`
| |
| |
LL | | //~^ ERROR: coroutine cannot be sent between threads safely
LL | | let a = NotSend;
LL | | drop(a);
LL | | });
LL | | });
| |______^ `NotSend` cannot be sent between threads safely
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/not-send-sync.rs:21:17: 21:19}`, the trait `Send` is not implemented for `NotSend`, which is required by `{coroutine@/checkout/tests/ui/coroutine/not-send-sync.rs:21:17: 21:19}: Send`
--> /checkout/tests/ui/coroutine/not-send-sync.rs:21:17
|
LL | assert_send(|| {
| ^^
| ^^
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/not-send-sync.rs:12:23
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `derived_drop::Client` cannot be sent between threads safely
2 --> $DIR/parent-expression.rs:23:13
3 |
+ LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
+ | ------- within this `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}`
4 LL | assert_send(g);
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^ `derived_drop::Client` cannot be sent between threads safely
6 ...
6 ...
7 LL | / type_combinations!(
8 LL | | // OK
14 | |_____- in this macro invocation
15 |
16 = help: within `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `derived_drop::Client`, which is required by `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/parent-expression.rs:17:21
19 |
19 |
20 LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
- | ------------------------ has type `derived_drop::Client` which is not `Send`
22 ...
- LL | _ => yield,
- LL | _ => yield,
- | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later
26 LL | / type_combinations!(
27 LL | | // OK
27 LL | | // OK
28 LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
38 | ^^^^ required by this bound in `assert_send`
39 = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
40
- error: coroutine cannot be sent between threads safely
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `significant_drop::Client` cannot be sent between threads safely
42 --> $DIR/parent-expression.rs:23:13
43 |
+ LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
+ | ------- within this `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}`
44 LL | assert_send(g);
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^ `significant_drop::Client` cannot be sent between threads safely
46 ...
46 ...
47 LL | / type_combinations!(
48 LL | | // OK
54 | |_____- in this macro invocation
55 |
56 = help: within `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `significant_drop::Client`, which is required by `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/parent-expression.rs:17:21
59 |
59 |
60 LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
- | ------------------------ has type `significant_drop::Client` which is not `Send`
62 ...
- LL | _ => yield,
- LL | _ => yield,
- | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later
66 LL | / type_combinations!(
67 LL | | // OK
67 LL | | // OK
68 LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
78 | ^^^^ required by this bound in `assert_send`
79 = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
80
- error: coroutine cannot be sent between threads safely
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `insignificant_dtor::Client` cannot be sent between threads safely
83 |
83 |
+ LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
+ | ------- within this `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}`
84 LL | assert_send(g);
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
- | ^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^ `insignificant_dtor::Client` cannot be sent between threads safely
87 LL | / type_combinations!(
88 LL | | // OK
94 | |_____- in this macro invocation
94 | |_____- in this macro invocation
95 |
96 = help: within `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client`, which is required by `{coroutine@$DIR/parent-expression.rs:17:21: 17:28}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/parent-expression.rs:17:21
99 |
99 |
100 LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
- | ------------------------ has type `insignificant_dtor::Client` which is not `Send`
102 ...
- LL | _ => yield,
- LL | _ => yield,
- | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later
106 LL | / type_combinations!(
107 LL | | // OK
107 LL | | // OK
108 LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
120
121 error: aborting due to 3 previous errors
122
+ For more information about this error, try `rustc --explain E0277`.
---
--- stderr -------------------------------
error[E0277]: `derived_drop::Client` cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/parent-expression.rs:23:13
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}`
LL | assert_send(g);
| ^^^^^^^^^^^^^^ `derived_drop::Client` cannot be sent between threads safely
...
LL | / type_combinations!(
LL | / type_combinations!(
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `derived_drop::Client`, which is required by `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}: Send`
--> /checkout/tests/ui/coroutine/parent-expression.rs:17:21
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
...
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/parent-expression.rs:40:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `significant_drop::Client` cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/parent-expression.rs:23:13
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}`
LL | assert_send(g);
| ^^^^^^^^^^^^^^ `significant_drop::Client` cannot be sent between threads safely
...
LL | / type_combinations!(
LL | / type_combinations!(
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `significant_drop::Client`, which is required by `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}: Send`
--> /checkout/tests/ui/coroutine/parent-expression.rs:17:21
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
...
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/parent-expression.rs:40:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `insignificant_dtor::Client` cannot be sent between threads safely
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
| ------- within this `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}`
LL | assert_send(g);
LL | assert_send(g);
| ^^^^^^^^^^^^^^ `insignificant_dtor::Client` cannot be sent between threads safely
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client`, which is required by `{coroutine@/checkout/tests/ui/coroutine/parent-expression.rs:17:21: 17:28}: Send`
--> /checkout/tests/ui/coroutine/parent-expression.rs:17:21
|
|
LL | let g = move || match drop($name::Client { ..$name::Client::default() }) {
...
LL | / type_combinations!(
LL | | // OK
LL | | // OK
LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; };
LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though
LL | | };
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/parent-expression.rs:40:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/coroutine/print/coroutine-print-verbose-2.rs stdout ----
diff of stderr:
- error: coroutine cannot be shared between threads safely
+ error[E0277]: `NotSync` cannot be shared between threads safely
3 |
- LL | / assert_sync(|| {
+ LL | assert_sync(|| {
+ LL | assert_sync(|| {
+ | ^ -- within this `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`
+ | |
5 LL | |
6 LL | | let a = NotSync;
7 LL | | yield;
7 LL | | yield;
8 LL | | drop(a);
9 LL | | });
- | |______^ coroutine is not `Sync`
+ | |______^ `NotSync` cannot be shared between threads safely
11 |
12 = help: within `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync`, which is required by `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}: Sync`
- note: coroutine is not `Sync` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/coroutine-print-verbose-2.rs:17:17
15 |
- LL | let a = NotSync;
- LL | let a = NotSync;
- | - has type `NotSync` which is not `Sync`
- LL | yield;
- | ^^^^^ yield occurs here, with `a` maybe used later
+ LL | assert_sync(|| {
20 note: required by a bound in `assert_sync`
21 --> $DIR/coroutine-print-verbose-2.rs:14:23
22 |
23 LL | fn assert_sync<T: Sync>(_: T) {}
24 | ^^^^ required by this bound in `assert_sync`
- error: coroutine cannot be sent between threads safely
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `NotSend` cannot be sent between threads safely
28 |
- LL | / assert_send(|| {
+ LL | assert_send(|| {
+ LL | assert_send(|| {
+ | ^ -- within this `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`
+ | |
30 LL | |
31 LL | | let a = NotSend;
32 LL | | yield;
32 LL | | yield;
33 LL | | drop(a);
34 LL | | });
- | |______^ coroutine is not `Send`
+ | |______^ `NotSend` cannot be sent between threads safely
36 |
37 = help: within `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend`, which is required by `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}: Send`
- note: coroutine is not `Send` as this value is used across a yield
+ note: required because it's used within this coroutine
+ --> $DIR/coroutine-print-verbose-2.rs:24:17
40 |
- LL | let a = NotSend;
- LL | let a = NotSend;
- | - has type `NotSend` which is not `Send`
- LL | yield;
- | ^^^^^ yield occurs here, with `a` maybe used later
+ LL | assert_send(|| {
45 note: required by a bound in `assert_send`
46 --> $DIR/coroutine-print-verbose-2.rs:15:23
47 |
---
To only update this specific test, also pass `--test-args coroutine/print/coroutine-print-verbose-2.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/print/coroutine-print-verbose-2.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/coroutine/print/coroutine-print-verbose-2" "-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/coroutine/print/coroutine-print-verbose-2/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0277]: `NotSync` cannot be shared between threads safely
|
LL | assert_sync(|| {
LL | assert_sync(|| {
| ^ -- within this `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`
| |
| |
LL | | //~^ ERROR: coroutine cannot be shared between threads safely
LL | | let a = NotSync;
LL | | drop(a);
LL | | });
LL | | });
| |______^ `NotSync` cannot be shared between threads safely
|
= help: within `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync`, which is required by `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}: Sync`
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-2.rs:17:17
|
LL | assert_sync(|| {
| ^^
| ^^
note: required by a bound in `assert_sync`
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-2.rs:14:23
|
LL | fn assert_sync<T: Sync>(_: T) {}
| ^^^^ required by this bound in `assert_sync`
error[E0277]: `NotSend` cannot be sent between threads safely
|
LL | assert_send(|| {
LL | assert_send(|| {
| ^ -- within this `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`
| |
| |
LL | | //~^ ERROR: coroutine cannot be sent between threads safely
LL | | let a = NotSend;
LL | | drop(a);
LL | | });
LL | | });
| |______^ `NotSend` cannot be sent between threads safely
|
= help: within `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend`, which is required by `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}: Send`
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-2.rs:24:17
|
LL | assert_send(|| {
| ^^
| ^^
note: required by a bound in `assert_send`
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-2.rs:15:23
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/coroutine/print/coroutine-print-verbose-1.rs stdout ----
diff of stderr:
- error: coroutine cannot be sent between threads safely
+ error[E0277]: `RefCell<i32>` cannot be shared between threads safely
3 |
4 LL | require_send(send_gen);
- | ^^^^^^^^^^^^^^^^^^^^^^ coroutine is not `Send`
- | ^^^^^^^^^^^^^^^^^^^^^^ coroutine is not `Send`
+ | ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
6 |
7 = help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{test1::{closure#0} upvar_tys=() witness={test1::{closure#0}}}: Send`
8 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
- note: coroutine is not `Send` as this value is used across a yield
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
+ note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
11 |
11 |
- LL | let _non_send_gen = make_non_send_coroutine();
- | ------------- has type `Opaque(DefId(0:34 ~ coroutine_print_verbose_1[75fb]::make_non_send_coroutine::{opaque#0}), [])` which is not `Send`
- LL | yield;
- | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
+ LL | pub struct Ready<T>(Option<T>);
+ | ^^^^^
+ note: required because it appears within the type `Opaque(DefId(0:34 ~ coroutine_print_verbose_1[75fb]::make_non_send_coroutine::{opaque#0}), [])`
+ |
+ |
+ LL | fn make_non_send_coroutine() -> impl Coroutine<Return = Arc<RefCell<i32>>> {
+ note: required because it's used within this coroutine
+ --> $DIR/coroutine-print-verbose-1.rs:33:20
+ |
+ |
+ LL | let send_gen = || {
16 note: required by a bound in `require_send`
17 --> $DIR/coroutine-print-verbose-1.rs:26:25
18 |
---
To only update this specific test, also pass `--test-args coroutine/print/coroutine-print-verbose-1.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/print/coroutine-print-verbose-1.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/coroutine/print/coroutine-print-verbose-1" "-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/coroutine/print/coroutine-print-verbose-1/auxiliary" "-Zverbose-internals"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
|
LL | require_send(send_gen);
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{test1::{closure#0} upvar_tys=() witness={test1::{closure#0}}}: Send`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it appears within the type `Option<Arc<RefCell<i32>>>`
--> /rustc/FAKE_PREFIX/library/core/src/option.rs:571:10
note: required because it appears within the type `Ready<Arc<RefCell<i32>>>`
|
|
LL | pub struct Ready<T>(Option<T>);
| ^^^^^
note: required because it appears within the type `Opaque(DefId(0:34 ~ coroutine_print_verbose_1[75fb]::make_non_send_coroutine::{opaque#0}), [])`
|
|
LL | fn make_non_send_coroutine() -> impl Coroutine<Return = Arc<RefCell<i32>>> {
note: required because it's used within this coroutine
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-1.rs:33:20
|
|
LL | let send_gen = || {
note: required by a bound in `require_send`
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-1.rs:26:25
|
|
LL | fn require_send(_: impl Send) {}
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
|
LL | require_send(send_gen);
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{test2::{closure#0} upvar_tys=() witness={test2::{closure#0}}}: Send`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-1.rs:42:5
|
LL | || {
| ^^
| ^^
note: required because it appears within the type `Opaque(DefId(0:35 ~ coroutine_print_verbose_1[75fb]::make_gen2::{opaque#0}), [Arc<RefCell<i32>>])`
|
|
LL | pub fn make_gen2<T>(t: T) -> impl Coroutine<Return = T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `Opaque(DefId(0:36 ~ coroutine_print_verbose_1[75fb]::make_non_send_coroutine2::{opaque#0}), [])`
|
|
LL | fn make_non_send_coroutine2() -> impl Coroutine<Return = Arc<RefCell<i32>>> {
note: required because it's used within this coroutine
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-1.rs:52:20
|
|
LL | let send_gen = || {
note: required by a bound in `require_send`
--> /checkout/tests/ui/coroutine/print/coroutine-print-verbose-1.rs:26:25
|
|
LL | fn require_send(_: impl Send) {}
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
---
diff of stderr:
61 | |______^ coroutine is not `Send`
62 |
63 = help: the trait `Sync` is not implemented for `*mut ()`, which is required by `{coroutine@$DIR/ref-upvar-not-send.rs:19:17: 19:24}: Send`
- note: coroutine is not `Send` as this value is used across a yield
- --> $DIR/ref-upvar-not-send.rs:19:17
+ note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
66 |
- LL | assert_send(move || {
- | ^------
- | |
- | |
- | yield occurs here, with `move ||` maybe used later
- | has type `&*mut ()` which is not `Send`
+ LL | let _x = x;
+ | ^ has type `&*mut ()` which is not `Send`, because `*mut ()` is not `Sync`
72 note: required by a bound in `assert_send`
74 |
88 | |______^ coroutine is not `Send`
89 |
89 |
90 = help: within `{coroutine@$DIR/ref-upvar-not-send.rs:32:17: 32:24}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{coroutine@$DIR/ref-upvar-not-send.rs:32:17: 32:24}: Send`
- note: coroutine is not `Send` as this value is used across a yield
- --> $DIR/ref-upvar-not-send.rs:32:17
+ note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
93 |
- LL | assert_send(move || {
- | ^------
- | |
- | |
- | yield occurs here, with `move ||` maybe used later
- | has type `&mut *mut ()` which is not `Send`
+ LL | let _y = y;
+ | ^ has type `&mut *mut ()` which is not `Send`, because `*mut ()` is not `Send`
99 note: required by a bound in `assert_send`
101 |
The actual stderr differed from the expected stderr.
---
##[error] --> /checkout/tests/ui/coroutine/ref-upvar-not-send.rs:19:17
|
LL | assert_send(move || {
| _________________^
LL | | //~^ ERROR coroutine cannot be sent between threads safely
LL | | //~| NOTE coroutine is not `Send`
LL | | //~| NOTE coroutine is not `Send` as this value is used across a yield
... |
LL | | //~| NOTE has type `&*mut ()` which is not `Send`, because `*mut ()` is not `Sync`
| |_____^ coroutine is not `Send`
|
|
= help: the trait `Sync` is not implemented for `*mut ()`, which is required by `{coroutine@/checkout/tests/ui/coroutine/ref-upvar-not-send.rs:19:17: 19:24}: Send`
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
|
LL | let _x = x;
LL | let _x = x;
| ^ has type `&*mut ()` which is not `Send`, because `*mut ()` is not `Sync`
note: required by a bound in `assert_send`
|
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: coroutine cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/ref-upvar-not-send.rs:32:17
|
LL | assert_send(move || {
LL | assert_send(move || {
| _________________^
LL | | //~^ ERROR coroutine cannot be sent between threads safely
LL | | //~| NOTE coroutine is not `Send`
LL | | //~| ERROR coroutine cannot be sent between threads safely
... |
LL | | //~| has type `&mut *mut ()` which is not `Send`, because `*mut ()` is not `Send`
| |_____^ coroutine is not `Send`
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/ref-upvar-not-send.rs:32:17: 32:24}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{coroutine@/checkout/tests/ui/coroutine/ref-upvar-not-send.rs:32:17: 32:24}: Send`
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
|
|
LL | let _y = y;
| ^ has type `&mut *mut ()` which is not `Send`, because `*mut ()` is not `Send`
note: required by a bound in `assert_send`
|
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: coroutine cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/ref-upvar-not-send.rs:19:5
|
LL | / assert_send(move || {
LL | / assert_send(move || {
LL | | //~^ ERROR coroutine cannot be sent between threads safely
LL | | //~| NOTE coroutine is not `Send`
LL | | //~| NOTE coroutine is not `Send` as this value is used across a yield
... |
LL | | //~| NOTE has type `&*mut ()` which is not `Send`, because `*mut ()` is not `Sync`
| |______^ coroutine is not `Send`
|
|
= help: the trait `Sync` is not implemented for `*mut ()`, which is required by `{coroutine@/checkout/tests/ui/coroutine/ref-upvar-not-send.rs:19:17: 19:24}: Send`
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
|
LL | let _x = x;
LL | let _x = x;
| ^ has type `&*mut ()` which is not `Send`, because `*mut ()` is not `Sync`
note: required by a bound in `assert_send`
|
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: coroutine cannot be sent between threads safely
##[error] --> /checkout/tests/ui/coroutine/ref-upvar-not-send.rs:32:5
|
LL | / assert_send(move || {
LL | / assert_send(move || {
LL | | //~^ ERROR coroutine cannot be sent between threads safely
LL | | //~| NOTE coroutine is not `Send`
LL | | //~| ERROR coroutine cannot be sent between threads safely
... |
LL | | //~| has type `&mut *mut ()` which is not `Send`, because `*mut ()` is not `Send`
| |______^ coroutine is not `Send`
|
|
= help: within `{coroutine@/checkout/tests/ui/coroutine/ref-upvar-not-send.rs:32:17: 32:24}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{coroutine@/checkout/tests/ui/coroutine/ref-upvar-not-send.rs:32:17: 32:24}: Send`
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
|
|
LL | let _y = y;
| ^ has type `&mut *mut ()` which is not `Send`, because `*mut ()` is not `Send`
note: required by a bound in `assert_send`
|
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to 4 previous errors
------------------------------------------
---- [ui] tests/ui/traits/unsend-future.rs stdout ----
diff of stderr:
- error: future cannot be sent between threads safely
+ error[E0277]: `*const i32` cannot be sent between threads safely
3 |
3 |
+ LL | async fn handler() {
+ | ------------------ within this `impl Future<Output = ()>`
4 LL | require_handler(handler)
4 LL | require_handler(handler)
- | ^^^^^^^ future returned by `handler` is not `Send`
+ | --------------- ^^^^^^^ `*const i32` cannot be sent between threads safely
+ | required by a bound introduced by this call
6 |
6 |
7 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `*const i32`, which is required by `fn() -> impl Future<Output = ()> {handler}: Handler`
- note: future is not `Send` as this value is used across an await
- --> $DIR/unsend-future.rs:15:14
+ note: required because it's used within this `async` fn body
10 |
10 |
- LL | let a = &1 as *const i32;
- | - has type `*const i32` which is not `Send`
- LL | async {}.await;
- | ^^^^^ await occurs here, with `a` maybe used later
+ LL | async fn handler() {
+ | ____________________^
+ LL | | let a = &1 as *const i32;
+ LL | | async {}.await;
+ LL | | let b = a;
+ LL | | }
+ | |_^
+ note: required for `fn() -> impl Future<Output = ()> {handler}` to implement `Handler`
+ |
+ |
+ LL | impl<F, Fut> Handler for F
+ LL | where
+ LL | Fut: Send,
+ | ---- unsatisfied trait bound introduced here
15 note: required by a bound in `require_handler`
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/unsend-future.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/traits/unsend-future" "-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/traits/unsend-future/auxiliary" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0277]: `*const i32` cannot be sent between threads safely
|
LL | async fn handler() {
| ------------------ within this `impl Future<Output = ()>`
...
...
LL | require_handler(handler)
| --------------- ^^^^^^^ `*const i32` cannot be sent between threads safely
| required by a bound introduced by this call
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `*const i32`, which is required by `fn() -> impl Future<Output = ()> {handler}: Handler`
note: required because it's used within this `async` fn body
|
LL | async fn handler() {
| ____________________^
| ____________________^
LL | | let a = &1 as *const i32;
LL | | async {}.await;
LL | | let b = a;
| |_^
| |_^
note: required for `fn() -> impl Future<Output = ()> {handler}` to implement `Handler`
|
|
LL | impl<F, Fut> Handler for F
LL | where
LL | Fut: Send,
| ---- unsatisfied trait bound introduced here
note: required by a bound in `require_handler`
note: required by a bound in `require_handler`
--> /checkout/tests/ui/traits/unsend-future.rs:11:23
|
LL | fn require_handler<H: Handler>(h: H) {}
| ^^^^^^^ required by this bound in `require_handler`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
------------------------------------------
The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Running tests/compile-test.rs (obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/compile_test-453d830fd0023675)
FAILED TEST: tests/ui/future_not_send.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-d901a432f9b5437d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-c39b683b0ce40234.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-a841394a3899e7db.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-b9aa5555d3eeb00c.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-9152caa60d22e5d6.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-6014a4e4c8724228.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-93d7303c6012a33b.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-dd6285fa210e40f1.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-f6a8ee4fbadda337.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-7f0d708317b92523.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-5e386b163d38144b.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-b7759248f5057cd2.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/future_not_send.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/future_not_send.stderr` to the actual output
--- tests/ui/future_not_send.stderr
thread 'main' panicked at src/tools/clippy/tests/compile-test.rs:176:6:
---
+++ <stderr output>
error: future cannot be sent between threads safely
--> tests/ui/future_not_send.rs:7:1
... 2 lines skipped ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
-note: captured value is not `Send`
-note: captured value is not `Send`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:9:20
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
- | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
+ | -- has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:9:20
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
+ | ___________________________________________________________________-
LL | |
LL | | async { true }.await
LL | | async { true }.await
+ | | ^^^^^ await occurs here, with the value maybe used later
LL | | }
| |_- has type `&std::cell::Cell<usize>` which is not `Send`
... 8 lines skipped ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
-note: captured value is not `Send`
-note: captured value is not `Send`
+note: future is not `Send` as this value is used across an await
+ --> tests/ui/future_not_send.rs:14:20
|
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
- | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
+ | -- has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
... 10 lines skipped ...
... 10 lines skipped ...
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
-note: future is not `Send` as this value is used across an await
+note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
+ --> tests/ui/future_not_send.rs:21:40
|
|
-LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
+LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
- | ^
+ | ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
... 20 lines skipped ...
--> tests/ui/future_not_send.rs:40:24
|
-LL | async fn private_future(&self) -> usize {
-LL | async fn private_future(&self) -> usize {
+LL | async fn private_future(&self) -> usize {
- | _____________________________________________-
+ | ----- has type `&Dummy` which is not `Send`
+LL |
-LL | | async { true }.await;
+LL | async { true }.await;
+LL | async { true }.await;
- | | ^^^^^ await occurs here, with the value maybe used later
+ | ^^^^^ await occurs here, with `&self` maybe used later
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
... 49 lines skipped ...
error: aborting due to 8 previous errors
full stderr:
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:7:1
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
LL | async { true }.await
LL | async { true }.await
| ^^^^^ await occurs here, with `rc` maybe used later
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
note: future is not `Send` as this value is used across an await
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
LL | |
LL | | async { true }.await
LL | | async { true }.await
| | ^^^^^ await occurs here, with the value maybe used later
LL | | }
| |_- has type `&std::cell::Cell<usize>` which is not `Send`
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
= note: `-D clippy::future-not-send` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:12:1
|
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
LL | async { true }.await;
LL | async { true }.await;
| ^^^^^ await occurs here, with `rc` maybe used later
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:21:1
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
note: captured value is not `Send`
--> tests/ui/future_not_send.rs:21:26
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:26:1
|
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
note: captured value is not `Send`
--> tests/ui/future_not_send.rs:26:29
|
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:38:5
|
LL | async fn private_future(&self) -> usize {
LL | async fn private_future(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
LL | async fn private_future(&self) -> usize {
LL | async fn private_future(&self) -> usize {
| ----- has type `&Dummy` which is not `Send`
LL | async { true }.await;
LL | async { true }.await;
| ^^^^^ await occurs here, with `&self` maybe used later
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:44:5
|
LL | pub async fn public_future(&self) {
LL | pub async fn public_future(&self) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
LL | pub async fn public_future(&self) {
| _______________________________________-
LL | |
LL | |
LL | | self.private_future().await;
| | ^^^^^ await occurs here, with the value maybe used later
LL | | }
| |_____- has type `&Dummy` which is not `Send`
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:55:1
|
|
LL | / async fn generic_future<T>(t: T) -> T
LL | | where
LL | | T: Send,
LL | | T: Send,
| |____________^ future returned by `generic_future` is not `Send`
|
note: future is not `Send` as this value is used across an await
|
LL | let rt = &t;
LL | let rt = &t;
| -- has type `&T` which is not `Send`
LL | async { true }.await;
| ^^^^^ await occurs here, with `rt` maybe used later
= note: `T` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
##[error] --> tests/ui/future_not_send.rs:73:1
|
|
LL | async fn unclear_future<T>(t: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
note: captured value is not `Send`
--> tests/ui/future_not_send.rs:73:28
|
|
LL | async fn unclear_future<T>(t: T) {}
| ^ has type `T` which is not `Send`
= note: `T` doesn't implement `std::marker::Send`
error: aborting due to 8 previous errors
full stdout:
:umbrella: The latest upstream changes (presumably #123402) made this pull request unmergeable. Please resolve the merge conflicts.
@flip1995 Somehow I can't respond to your change request. I have decided to skip over the upvars in the additional notes.
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)
Checking if_chain v1.0.2
error: unnecessary qualification
--> src/tools/clippy/clippy_lints/src/await_holding_invalid.rs:214:20
|
214 | if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind() {
|
= note: `-D unused-qualifications` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unused_qualifications)]`
help: remove the unnecessary path segments
help: remove the unnecessary path segments
|
214 - if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind() {
214 + if let ty::Adt(adt, _) = ty_cause.ty.kind() {
error: could not compile `clippy_lints` (lib) due to 1 previous error
Build completed unsuccessfully in 0:02:59
local time: Fri Apr 5 13:09:15 UTC 2024
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 exporting to docker image format
#16 sending tarball 29.5s done
#16 DONE 34.4s
##[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-17]
---
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-17', '--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', '--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-17/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 ----
77 },
78 4: SourceInfo {
79 span: $DIR/async_await.rs:17:9: 17:14 (#10),
- scope: scope[4],
+ scope: scope[3],
82 },
83 } */
thread '[mir-opt] tests/mir-opt/building/async_await.rs' panicked at src/tools/compiletest/src/runtest.rs:4351:21:
thread '[mir-opt] tests/mir-opt/building/async_await.rs' panicked at src/tools/compiletest/src/runtest.rs:4351: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
:umbrella: The latest upstream changes (presumably #123645) made this pull request unmergeable. Please resolve the merge conflicts.
:umbrella: The latest upstream changes (presumably #123708) made this pull request unmergeable. Please resolve the merge conflicts.
@bors try @rust-timer queue
@dingxiangfei2009: :key: Insufficient privileges: not in try users