Skip to content

Initial UnsafePinned implementation [Part 2: Lowering] #139896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sky9x
Copy link
Contributor

@Sky9x Sky9x commented Apr 16, 2025

Coroutine lowering part of RFC 3467.
Tracking issue: #125735
Part 1: #137043

  • Coroutines now track which of their stored locals are borrowed across suspension points and thus must be considered pinned.
  • UnsafeUnpin for coroutines:
    • if the coro is movable, it always implements UnsafeUnpin. (movable coros never have pinned fields)
    • if it is immovable (static), it implements UnsafeUnpin iff none of its fields are pinned.

Still TODO (for later PRs):

  • Coroutine layout (restore niche opts)
  • Codegen (noalias metadata etc)
  • Miri

@rustbot label F-unsafe_pinned F-coroutines A-coroutines

cc @RalfJung @compiler-errors @traviscross

@rustbot
Copy link
Collaborator

rustbot commented Apr 16, 2025

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) A-coroutines Area: Coroutines F-coroutines `#![feature(coroutines)]` F-unsafe_pinned `#![feature(unsafe_pinned)]` labels Apr 16, 2025
@Sky9x Sky9x marked this pull request as ready for review April 16, 2025 07:11
@rustbot
Copy link
Collaborator

rustbot commented Apr 16, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@RalfJung
Copy link
Member

Movable coroutines now always implement UnsafeUnpin and immovable coroutines now never implement UnsafeUnpin.

"always" sounds wrong; a movable coroutine could have an UnsafeUnpin type as a field, right?

I understand this is consistent with what we do with Unpin today, but I wonder why we don't just let the auto trait do its thing: if all variables for all yield points are UnsafeUnpin, we just propagate that. So even immotable coroutines could be UnsafeUnpin if they happen to not have any references across yield points.

Coroutine layout (restore niche opts)

This is missing context -- what is the interaction with niche ops?

@Sky9x Sky9x force-pushed the unsafe-pinned-pt2-lowering branch from f44b09f to 03ef470 Compare April 16, 2025 19:30
@Sky9x
Copy link
Contributor Author

Sky9x commented Apr 16, 2025

Movable coroutines now always implement UnsafeUnpin and immovable coroutines now never implement UnsafeUnpin.

"always" sounds wrong; a movable coroutine could have an UnsafeUnpin type as a field, right?

I understand this is consistent with what we do with Unpin today, but I wonder why we don't just let the auto trait do its thing: if all variables for all yield points are UnsafeUnpin, we just propagate that. So even immotable coroutines could be UnsafeUnpin if they happen to not have any references across yield points.

Updated the trait solving logic to only implement UnsafeUnpin if no fields are pinned. This allows immovable (static) coros with no pinned fields to implement UnsafeUnpin.

Coroutine layout (restore niche opts)

This is missing context -- what is the interaction with niche ops?

#129313 Disabled niches in coroutines because of #63818. The planned "Part 3: Codegen" will restore this.

@Sky9x
Copy link
Contributor Author

Sky9x commented Apr 16, 2025

I'm not sure how to write tests checking impls of UnsafeUnpin as the trait is private in libcore

@RalfJung
Copy link
Member

#129313 Disabled niches in coroutines because of #63818. The planned "Part 3: Codegen" will restore this.

Ah, but only outside pinned fields I assume. :)

@Sky9x Sky9x force-pushed the unsafe-pinned-pt2-lowering branch from 03ef470 to 661ccd2 Compare April 21, 2025 06:37
@Sky9x Sky9x changed the title Initial UnsafePinned impl [Part 2: Lowering] Initial UnsafePinned implementation [Part 2: Lowering] Apr 21, 2025
@rust-log-analyzer

This comment has been minimized.

@Sky9x Sky9x marked this pull request as draft April 21, 2025 07:03
@Sky9x Sky9x force-pushed the unsafe-pinned-pt2-lowering branch from 661ccd2 to 3e1cce7 Compare April 21, 2025 16:11
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#19 exporting to docker image format
#19 sending tarball 20.0s done
#19 DONE 33.6s
##[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-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--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', 'rust.lld=false', '--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: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
  Number of decisions:   4447
  longest path:          1159 (code:    152)
  longest backtrack:       66 (code:    428)
Shared 86733 out of 152951 states by creating 14756 new states, saving 71977
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc: In function ‘rtx_def* extract_bit_field_1(rtx, poly_uint64, poly_uint64, int, rtx, machine_mode, machine_mode, bool, bool, rtx_def**)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc:1864:45: warning: ‘*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))’ may be used uninitialized [-Wmaybe-uninitialized]
 1864 |       rtx sub = extract_bit_field_as_subreg (mode1, op0, imode,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
 1865 |                                              bitsize, bitnum);
      |                                              ~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc:1824:19: note: ‘*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))’ was declared here
 1824 |   scalar_int_mode imode;
      |                   ^~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gimple-range-gori.cc: In member function ‘void range_def_chain::dump(FILE*, basic_block, const char*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gimple-range-gori.cc:319:19: warning: format not a string literal and no format arguments [-Wformat-security]
  319 |           fprintf (f, prefix);
      |           ~~~~~~~~^~~~~~~~~~~
---
                 from /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/region-model.h:33,
                 from /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc:39:
In constructor ‘ana::byte_range::byte_range(ana::byte_offset_t, ana::byte_size_t)’,
    inlined from ‘virtual text_art::table ana::string_literal_spatial_item::make_table(const ana::bit_to_table_map&, text_art::style_manager&) const’ at /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc:1812:18:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/store.h:312:5: warning: ‘size_in_bytes.generic_wide_int<fixed_wide_int_storage<128> >::fixed_wide_int_storage<128>.fixed_wide_int_storage<128>::val[1]’ may be used uninitialized [-Wmaybe-uninitialized]
  312 |     m_size_in_bytes (size_in_bytes)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc: In member function ‘virtual text_art::table ana::string_literal_spatial_item::make_table(const ana::bit_to_table_map&, text_art::style_manager&) const’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc:1808:28: note: ‘size_in_bytes.generic_wide_int<fixed_wide_int_storage<128> >::fixed_wide_int_storage<128>.fixed_wide_int_storage<128>::val[1]’ was declared here
 1808 |                byte_size_t size_in_bytes
      |                            ^~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/diagnostic.cc: In function ‘void fancy_abort(const char*, int, const char*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/diagnostic.cc:1677:15: warning: format not a string literal and no format arguments [-Wformat-security]
 1677 |       fnotice (stderr, diagnostic_kind_text[DK_ICE]);
---
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc:7930:9: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 7930 |   write (fd, "\n\n", 2);
      |   ~~~~~~^~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc: In member function ‘void driver::final_actions() const’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc:9307:13: warning: ignoring return value of ‘int truncate(const char*, __off_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 9307 |     truncate(totruncate_file, 0);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto-wrapper.cc: In function ‘bool find_and_merge_options(int, off_t, const char*, vec<cl_decoded_option>, bool, vec<cl_decoded_option>*, const char*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto-wrapper.cc:1165:8: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1165 |   read (fd, data, length);
      |   ~~~~~^~~~~~~~~~~~~~~~~~
---
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc: In function ‘void lto_resolution_read(splay_tree, FILE*, lto_file*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2091:10: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2091 |   fscanf (resolution, " ");   /* Read white space.  */
      |   ~~~~~~~^~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2093:9: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2093 |   fread (obj_name, sizeof (char), name_len, resolution);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2113:10: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2113 |   fscanf (resolution, "%u", &num_symbols);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/jit/jit-recording.cc:32:
---
Applying io_quotes_use            to linux/blkzoned.h
Applying io_quotes_use            to linux/ipmi.h
Applying io_quotes_use            to linux/psp-dbc.h
Applying io_quotes_use            to linux/bt-bmc.h
Applying io_quotes_use            to linux/tps6594_pfsm.h
Applying io_quotes_use            to linux/cxl_mem.h
Applying io_quotes_use            to linux/wmi.h
Applying io_quotes_use            to linux/auto_fs.h
Applying io_quotes_use            to linux/mmtimer.h
Applying io_quotes_use            to linux/f2fs.h
Applying io_quotes_use            to linux/vhost.h
---
Applying io_quotes_use            to sound/asound.h
Applying io_quotes_use            to sound/compress_offload.h
Applying hpux8_bogus_inlines      to math.h
Applying pthread_incomplete_struct_argument to pthread.h
Fixed:  pthread.h
Applying io_quotes_use            to misc/mrvl_cn10k_dpi.h
Applying io_quotes_use            to misc/ocxl.h
Applying io_quotes_use            to misc/cxl.h
Applying io_quotes_use            to misc/xilinx_sdfec.h
Applying io_quotes_def            to unicode/platform.h
Applying sun_malloc               to malloc.h
Applying io_quotes_use            to scsi/cxlflash_ioctl.h
---
Applying machine_name             to x86_64-linux-gnu/bits/unistd_ext.h
Applying io_quotes_use            to x86_64-linux-gnu/asm/mtrr.h
Applying io_quotes_use            to x86_64-linux-gnu/asm/amd_hsmp.h
Applying machine_name             to openssl/e_os2.h
Applying io_quotes_use            to drm/xe_drm.h
Applying io_quotes_use            to drm/radeon_drm.h
Applying io_quotes_use            to drm/panfrost_drm.h
Applying io_quotes_use            to drm/etnaviv_drm.h
Applying io_quotes_use            to drm/lima_drm.h
Applying io_quotes_use            to drm/qaic_accel.h
Applying io_quotes_use            to drm/vc4_drm.h
Applying io_quotes_use            to drm/i915_drm.h
Applying io_quotes_use            to drm/omap_drm.h
Applying io_quotes_use            to drm/pvr_drm.h
Applying io_quotes_use            to drm/amdgpu_drm.h
Applying io_quotes_use            to drm/vgem_drm.h
Applying io_quotes_use            to drm/msm_drm.h
Applying io_quotes_use            to drm/v3d_drm.h
Applying io_quotes_use            to drm/exynos_drm.h
Applying io_quotes_use            to drm/nouveau_drm.h
Applying io_quotes_use            to drm/drm.h
Applying io_quotes_use            to drm/habanalabs_accel.h
Applying io_quotes_use            to drm/tegra_drm.h
Applying io_quotes_use            to rdma/rdma_user_ioctl.h
cc1: note: self-tests are not enabled in this build
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/c++tools/server.cc: In function ‘void server(bool, int, module_resolver*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/c++tools/server.cc:620:10: warning: ignoring return value of ‘int pipe(int*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
---
---- [ui] tests/ui/coroutine/drop-and-replace.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/drop-and-replace.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coroutine/drop-and-replace/a" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------

thread 'rustc' panicked at compiler/rustc_mir_transform/src/coroutine.rs:757:21:
local _3 of movable coro shouldn't be pinned, yet it is pinned by [_3]
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_mir_transform::coroutine::locals_live_across_suspend_points
   3: rustc_mir_transform::coroutine::mir_coroutine_witnesses
      [... omitted 3 frames ...]
   4: rustc_ty_utils::needs_drop::needs_drop_raw
      [... omitted 3 frames ...]
   5: <rustc_middle::ty::Ty>::needs_drop
   6: rustc_trait_selection::traits::query::dropck_outlives::dtorck_constraint_for_ty_inner
   7: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
   8: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, rustc_traits::dropck_outlives::dropck_outlives::{closure#0}>
   9: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  10: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::perform_query
  11: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::fully_perform_into
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::traits::query::DropckOutlivesResult, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>::{closure#0}>
  13: rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>
  14: <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform
  15: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  16: <indexmap::map::core::entry::Entry<rustc_middle::ty::Ty, rustc_borrowck::type_check::liveness::trace::DropData>>::or_insert_with::<<rustc_borrowck::type_check::liveness::trace::LivenessContext>::add_drop_live_facts_for::{closure#0}>
  17: rustc_borrowck::type_check::liveness::trace::trace
  18: rustc_borrowck::type_check::liveness::generate
  19: rustc_borrowck::nll::compute_regions
  20: rustc_borrowck::do_mir_borrowck
  21: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  22: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  23: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
  26: rustc_borrowck::nll::compute_regions
  27: rustc_borrowck::do_mir_borrowck
  28: rustc_borrowck::mir_borrowck
      [... omitted 3 frames ...]
  29: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  30: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  32: rustc_interface::passes::analysis
      [... omitted 3 frames ...]
  33: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  34: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  35: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  36: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  37: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (59e7b1f36 2025-04-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [mir_coroutine_witnesses] coroutine witness types for `main::{closure#0}`
#1 [needs_drop_raw] computing whether `{coroutine witness@/checkout/tests/ui/coroutine/drop-and-replace.rs:21:5: 21:7}` needs drop
#2 [dropck_outlives] computing dropck types for `{coroutine@/checkout/tests/ui/coroutine/drop-and-replace.rs:21:5: 21:7}`
#3 [mir_borrowck] borrow-checking `main`
#4 [analysis] running analysis passes on this crate
end of query stack
------------------------------------------


---- [ui] tests/ui/coroutine/drop-control-flow.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/drop-control-flow.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coroutine/drop-control-flow" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------

thread 'rustc' panicked at compiler/rustc_mir_transform/src/coroutine.rs:757:21:
local _3 of movable coro shouldn't be pinned, yet it is pinned by [_3]
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_mir_transform::coroutine::locals_live_across_suspend_points
   3: rustc_mir_transform::coroutine::mir_coroutine_witnesses
      [... omitted 3 frames ...]
   4: rustc_ty_utils::needs_drop::needs_drop_raw
      [... omitted 3 frames ...]
   5: <rustc_middle::ty::Ty>::needs_drop
   6: rustc_trait_selection::traits::query::dropck_outlives::dtorck_constraint_for_ty_inner
   7: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
   8: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, rustc_traits::dropck_outlives::dropck_outlives::{closure#0}>
   9: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  10: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::perform_query
  11: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::fully_perform_into
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::traits::query::DropckOutlivesResult, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>::{closure#0}>
  13: rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>
  14: <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform
  15: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  16: <indexmap::map::core::entry::Entry<rustc_middle::ty::Ty, rustc_borrowck::type_check::liveness::trace::DropData>>::or_insert_with::<<rustc_borrowck::type_check::liveness::trace::LivenessContext>::add_drop_live_facts_for::{closure#0}>
  17: rustc_borrowck::type_check::liveness::trace::trace
  18: rustc_borrowck::type_check::liveness::generate
  19: rustc_borrowck::nll::compute_regions
  20: rustc_borrowck::do_mir_borrowck
  21: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  22: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  23: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
  26: rustc_borrowck::nll::compute_regions
  27: rustc_borrowck::do_mir_borrowck
  28: rustc_borrowck::mir_borrowck
      [... omitted 3 frames ...]
  29: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  30: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  32: rustc_interface::passes::analysis
      [... omitted 3 frames ...]
  33: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  34: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  35: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  36: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  37: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (59e7b1f36 2025-04-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [mir_coroutine_witnesses] coroutine witness types for `reinit::{closure#0}`
#1 [needs_drop_raw] computing whether `{coroutine witness@/checkout/tests/ui/coroutine/drop-control-flow.rs:77:26: 77:28}` needs drop
#2 [dropck_outlives] computing dropck types for `{coroutine@/checkout/tests/ui/coroutine/drop-control-flow.rs:77:26: 77:28}`
#3 [mir_borrowck] borrow-checking `reinit`
#4 [analysis] running analysis passes on this crate
end of query stack

thread 'rustc' panicked at compiler/rustc_mir_transform/src/coroutine.rs:757:21:
local _3 of movable coro shouldn't be pinned, yet it is pinned by [_3]
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_mir_transform::coroutine::locals_live_across_suspend_points
   3: rustc_mir_transform::coroutine::mir_coroutine_witnesses
      [... omitted 3 frames ...]
   4: rustc_ty_utils::needs_drop::needs_drop_raw
      [... omitted 3 frames ...]
   5: <rustc_middle::ty::Ty>::needs_drop
   6: rustc_trait_selection::traits::query::dropck_outlives::dtorck_constraint_for_ty_inner
   7: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
   8: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, rustc_traits::dropck_outlives::dropck_outlives::{closure#0}>
   9: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  10: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::perform_query
  11: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::fully_perform_into
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::traits::query::DropckOutlivesResult, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>::{closure#0}>
  13: rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>
  14: <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform
  15: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  16: <indexmap::map::core::entry::Entry<rustc_middle::ty::Ty, rustc_borrowck::type_check::liveness::trace::DropData>>::or_insert_with::<<rustc_borrowck::type_check::liveness::trace::LivenessContext>::add_drop_live_facts_for::{closure#0}>
  17: rustc_borrowck::type_check::liveness::trace::trace
  18: rustc_borrowck::type_check::liveness::generate
  19: rustc_borrowck::nll::compute_regions
  20: rustc_borrowck::do_mir_borrowck
  21: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  22: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  23: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
  26: rustc_borrowck::nll::compute_regions
  27: rustc_borrowck::do_mir_borrowck
  28: rustc_borrowck::mir_borrowck
      [... omitted 3 frames ...]
  29: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  30: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  32: rustc_interface::passes::analysis
      [... omitted 3 frames ...]
  33: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  34: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  35: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  36: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  37: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (59e7b1f36 2025-04-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [mir_coroutine_witnesses] coroutine witness types for `loop_uninit::{closure#0}`
#1 [needs_drop_raw] computing whether `{coroutine witness@/checkout/tests/ui/coroutine/drop-control-flow.rs:86:26: 86:28}` needs drop
#2 [dropck_outlives] computing dropck types for `{coroutine@/checkout/tests/ui/coroutine/drop-control-flow.rs:86:26: 86:28}`
#3 [mir_borrowck] borrow-checking `loop_uninit`
#4 [analysis] running analysis passes on this crate
end of query stack

thread 'rustc' panicked at compiler/rustc_mir_transform/src/coroutine.rs:757:21:
local _3 of movable coro shouldn't be pinned, yet it is pinned by [_3]
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_mir_transform::coroutine::locals_live_across_suspend_points
   3: rustc_mir_transform::coroutine::mir_coroutine_witnesses
      [... omitted 3 frames ...]
   4: rustc_ty_utils::needs_drop::needs_drop_raw
      [... omitted 3 frames ...]
   5: <rustc_middle::ty::Ty>::needs_drop
   6: rustc_trait_selection::traits::query::dropck_outlives::dtorck_constraint_for_ty_inner
   7: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
   8: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, rustc_traits::dropck_outlives::dropck_outlives::{closure#0}>
   9: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  10: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::perform_query
  11: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::fully_perform_into
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::traits::query::DropckOutlivesResult, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>::{closure#0}>
  13: rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>
  14: <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform
  15: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  16: <indexmap::map::core::entry::Entry<rustc_middle::ty::Ty, rustc_borrowck::type_check::liveness::trace::DropData>>::or_insert_with::<<rustc_borrowck::type_check::liveness::trace::LivenessContext>::add_drop_live_facts_for::{closure#0}>
  17: rustc_borrowck::type_check::liveness::trace::trace
  18: rustc_borrowck::type_check::liveness::generate
  19: rustc_borrowck::nll::compute_regions
  20: rustc_borrowck::do_mir_borrowck
  21: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  22: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  23: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
  26: rustc_borrowck::nll::compute_regions
  27: rustc_borrowck::do_mir_borrowck
  28: rustc_borrowck::mir_borrowck
      [... omitted 3 frames ...]
  29: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  30: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  32: rustc_interface::passes::analysis
      [... omitted 3 frames ...]
  33: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  34: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  35: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  36: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  37: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (59e7b1f36 2025-04-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [mir_coroutine_witnesses] coroutine witness types for `nested_loop::{closure#0}`
#1 [needs_drop_raw] computing whether `{coroutine witness@/checkout/tests/ui/coroutine/drop-control-flow.rs:99:26: 99:28}` needs drop
#2 [dropck_outlives] computing dropck types for `{coroutine@/checkout/tests/ui/coroutine/drop-control-flow.rs:99:26: 99:28}`
#3 [mir_borrowck] borrow-checking `nested_loop`
#4 [analysis] running analysis passes on this crate
end of query stack

thread 'rustc' panicked at compiler/rustc_mir_transform/src/coroutine.rs:757:21:
local _3 of movable coro shouldn't be pinned, yet it is pinned by [_3]
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_mir_transform::coroutine::locals_live_across_suspend_points
   3: rustc_mir_transform::coroutine::mir_coroutine_witnesses
      [... omitted 3 frames ...]
   4: rustc_ty_utils::needs_drop::needs_drop_raw
      [... omitted 3 frames ...]
   5: <rustc_middle::ty::Ty>::needs_drop
   6: rustc_trait_selection::traits::query::dropck_outlives::dtorck_constraint_for_ty_inner
   7: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
   8: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, rustc_traits::dropck_outlives::dropck_outlives::{closure#0}>
   9: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  10: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::perform_query
  11: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::fully_perform_into
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::traits::query::DropckOutlivesResult, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>::{closure#0}>
  13: rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>
  14: <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform
  15: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  16: <indexmap::map::core::entry::Entry<rustc_middle::ty::Ty, rustc_borrowck::type_check::liveness::trace::DropData>>::or_insert_with::<<rustc_borrowck::type_check::liveness::trace::LivenessContext>::add_drop_live_facts_for::{closure#0}>
  17: rustc_borrowck::type_check::liveness::trace::trace
  18: rustc_borrowck::type_check::liveness::generate
  19: rustc_borrowck::nll::compute_regions
  20: rustc_borrowck::do_mir_borrowck
  21: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  22: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  23: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
  26: rustc_borrowck::nll::compute_regions
  27: rustc_borrowck::do_mir_borrowck
  28: rustc_borrowck::mir_borrowck
      [... omitted 3 frames ...]
  29: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  30: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  32: rustc_interface::passes::analysis
      [... omitted 3 frames ...]
  33: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  34: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  35: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  36: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  37: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (59e7b1f36 2025-04-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [mir_coroutine_witnesses] coroutine witness types for `loop_continue::{closure#0}`
#1 [needs_drop_raw] computing whether `{coroutine witness@/checkout/tests/ui/coroutine/drop-control-flow.rs:114:26: 114:28}` needs drop
#2 [dropck_outlives] computing dropck types for `{coroutine@/checkout/tests/ui/coroutine/drop-control-flow.rs:114:26: 114:28}`
#3 [mir_borrowck] borrow-checking `loop_continue`
#4 [analysis] running analysis passes on this crate
end of query stack
------------------------------------------


---- [ui] tests/ui/coroutine/reinit-in-match-guard.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/reinit-in-match-guard.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coroutine/reinit-in-match-guard" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------

thread 'rustc' panicked at compiler/rustc_mir_transform/src/coroutine.rs:757:21:
local _3 of movable coro shouldn't be pinned, yet it is pinned by [_3]
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_mir_transform::coroutine::locals_live_across_suspend_points
   3: rustc_mir_transform::coroutine::mir_coroutine_witnesses
      [... omitted 3 frames ...]
   4: rustc_ty_utils::needs_drop::needs_drop_raw
      [... omitted 3 frames ...]
   5: <rustc_middle::ty::Ty>::needs_drop
   6: rustc_trait_selection::traits::query::dropck_outlives::dtorck_constraint_for_ty_inner
   7: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
   8: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, rustc_traits::dropck_outlives::dropck_outlives::{closure#0}>
   9: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  10: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::perform_query
  11: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::fully_perform_into
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::traits::query::DropckOutlivesResult, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>::{closure#0}>
  13: rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>
  14: <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform
  15: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  16: <indexmap::map::core::entry::Entry<rustc_middle::ty::Ty, rustc_borrowck::type_check::liveness::trace::DropData>>::or_insert_with::<<rustc_borrowck::type_check::liveness::trace::LivenessContext>::add_drop_live_facts_for::{closure#0}>
  17: rustc_borrowck::type_check::liveness::trace::trace
  18: rustc_borrowck::type_check::liveness::generate
  19: rustc_borrowck::nll::compute_regions
  20: rustc_borrowck::do_mir_borrowck
  21: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  22: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  23: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
  26: rustc_borrowck::nll::compute_regions
  27: rustc_borrowck::do_mir_borrowck
  28: rustc_borrowck::mir_borrowck
      [... omitted 3 frames ...]
  29: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  30: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  32: rustc_interface::passes::analysis
      [... omitted 3 frames ...]
  33: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  34: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  35: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  36: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  37: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (59e7b1f36 2025-04-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [mir_coroutine_witnesses] coroutine witness types for `main::{closure#0}`
#1 [needs_drop_raw] computing whether `{coroutine witness@/checkout/tests/ui/coroutine/reinit-in-match-guard.rs:8:5: 8:7}` needs drop
#2 [dropck_outlives] computing dropck types for `{coroutine@/checkout/tests/ui/coroutine/reinit-in-match-guard.rs:8:5: 8:7}`
#3 [mir_borrowck] borrow-checking `main`
#4 [analysis] running analysis passes on this crate
end of query stack
------------------------------------------


---- [ui] tests/ui/coroutine/resume-arg-size.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/resume-arg-size.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coroutine/resume-arg-size/a" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------

thread 'rustc' panicked at compiler/rustc_mir_transform/src/coroutine.rs:757:21:
local _2 of movable coro shouldn't be pinned, yet it is pinned by [_2]
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_mir_transform::coroutine::locals_live_across_suspend_points
   3: rustc_mir_transform::coroutine::mir_coroutine_witnesses
      [... omitted 3 frames ...]
   4: rustc_ty_utils::needs_drop::needs_drop_raw
      [... omitted 3 frames ...]
   5: <rustc_middle::ty::Ty>::needs_drop
   6: rustc_trait_selection::traits::query::dropck_outlives::dtorck_constraint_for_ty_inner
   7: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
   8: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, rustc_traits::dropck_outlives::dropck_outlives::{closure#0}>
   9: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  10: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::perform_query
  11: <rustc_middle::traits::query::type_op::DropckOutlives as rustc_trait_selection::traits::query::type_op::QueryTypeOp>::fully_perform_into
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_middle::traits::query::DropckOutlivesResult, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>::{closure#0}>
  13: rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives>, rustc_middle::traits::query::DropckOutlivesResult, <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform::{closure#1}>
  14: <rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::DropckOutlives> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform
  15: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  16: <indexmap::map::core::entry::Entry<rustc_middle::ty::Ty, rustc_borrowck::type_check::liveness::trace::DropData>>::or_insert_with::<<rustc_borrowck::type_check::liveness::trace::LivenessContext>::add_drop_live_facts_for::{closure#0}>
  17: rustc_borrowck::type_check::liveness::trace::trace
  18: rustc_borrowck::type_check::liveness::generate
  19: rustc_borrowck::nll::compute_regions
  20: rustc_borrowck::do_mir_borrowck
  21: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::get_or_insert_nested
  22: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  23: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
  26: rustc_borrowck::nll::compute_regions
  27: rustc_borrowck::do_mir_borrowck
  28: rustc_borrowck::mir_borrowck
      [... omitted 3 frames ...]
  29: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  30: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  32: rustc_interface::passes::analysis
      [... omitted 3 frames ...]
  33: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  34: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  35: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  36: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  37: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.88.0-nightly (59e7b1f36 2025-04-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-coroutines Area: Coroutines F-coroutines `#![feature(coroutines)]` F-unsafe_pinned `#![feature(unsafe_pinned)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants