Skip to content

deref_target_place is not a deref projection #105881

Closed
@trinity-1686a

Description

@trinity-1686a

Code

use futures::{select, FutureExt, StreamExt}; // 0.3.25

async fn next_message() -> () {
    todo!()
}

async fn run_one_step() {
    let mut all_next_messages = vec![Box::pin(next_message())];

    select! {
        _ = futures::future::select_all(all_next_messages.iter_mut()).fuse() => {
            let _ = all_next_messages;
        },
    }
}

Meta

rustc --version --verbose:

rustc 1.68.0-nightly (0468a00ae 2022-12-17)
binary: rustc
commit-hash: 0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc
commit-date: 2022-12-17
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

error: internal compiler error: compiler/rustc_borrowck/src/diagnostics/move_errors.rs:301:18: deref_target_place is not a deref projection
Backtrace

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/compiler/rustc_errors/src/lib.rs:1576:9
stack backtrace:
   0:     0x7f162930085a - std::backtrace_rs::backtrace::libunwind::trace::h51cb40f2f8f23f31
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f162930085a - std::backtrace_rs::backtrace::trace_unsynchronized::hebc3338ffed58a56
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f162930085a - std::sys_common::backtrace::_print_fmt::h136f982a4680ac7f
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f162930085a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd1514baae6e42eb6
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f162936336e - core::fmt::write::hfbed4b54a5eebfee
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f16292f0bd5 - std::io::Write::write_fmt::h9f6098b6a54a9a94
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/io/mod.rs:1682:15
   6:     0x7f1629300625 - std::sys_common::backtrace::_print::h6e7a2bc7da6ecf73
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f1629300625 - std::sys_common::backtrace::print::h631b25ef82a0eea1
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f162930336f - std::panicking::default_hook::{{closure}}::h41299fc951b157c9
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/panicking.rs:267:22
   9:     0x7f16293030ab - std::panicking::default_hook::hd317023abfdceaed
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/panicking.rs:286:9
  10:     0x7f162c5cfcc1 - rustc_driver[8fc339cf4408bec4]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f1629303bad - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h813f31c5cc72640d
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/alloc/src/boxed.rs:2032:9
  12:     0x7f1629303bad - std::panicking::rust_panic_with_hook::h2e61684db9120e8e
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/panicking.rs:692:13
  13:     0x7f162ca76731 - std[14b7645e29e8dad4]::panicking::begin_panic::<rustc_errors[5442e185e098f882]::ExplicitBug>::{closure#0}
  14:     0x7f162ca75df6 - std[14b7645e29e8dad4]::sys_common::backtrace::__rust_end_short_backtrace::<std[14b7645e29e8dad4]::panicking::begin_panic<rustc_errors[5442e185e098f882]::ExplicitBug>::{closure#0}, !>
  15:     0x7f162cacfa86 - std[14b7645e29e8dad4]::panicking::begin_panic::<rustc_errors[5442e185e098f882]::ExplicitBug>
  16:     0x7f162ca745f6 - std[14b7645e29e8dad4]::panic::panic_any::<rustc_errors[5442e185e098f882]::ExplicitBug>
  17:     0x7f162ca73476 - <rustc_errors[5442e185e098f882]::HandlerInner>::bug::<&alloc[1a97d1c4ba9fe4a2]::string::String>
  18:     0x7f162ca730e0 - <rustc_errors[5442e185e098f882]::Handler>::bug::<&alloc[1a97d1c4ba9fe4a2]::string::String>
  19:     0x7f162cb38afe - rustc_middle[1a40b9d11a76de60]::ty::context::tls::with_context_opt::<rustc_middle[1a40b9d11a76de60]::ty::context::tls::with_opt<rustc_middle[1a40b9d11a76de60]::util::bug::opt_span_bug_fmt<rustc_span[fd000e025c1fef5b]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7f162cb38dc6 - rustc_middle[1a40b9d11a76de60]::util::bug::opt_span_bug_fmt::<rustc_span[fd000e025c1fef5b]::span_encoding::Span>
  21:     0x7f162a88d103 - rustc_middle[1a40b9d11a76de60]::util::bug::bug_fmt
  22:     0x7f162c34748e - <rustc_borrowck[c86664c7788b1f3c]::MirBorrowckCtxt>::report
  23:     0x7f162b1c1070 - rustc_borrowck[c86664c7788b1f3c]::do_mir_borrowck
  24:     0x7f162b1a8c69 - rustc_borrowck[c86664c7788b1f3c]::mir_borrowck
  25:     0x7f162b1a8145 - <rustc_borrowck[c86664c7788b1f3c]::provide::{closure#0} as core[486592e7c49a8aa]::ops::function::FnOnce<(rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::LocalDefId)>>::call_once
  26:     0x7f162b5ae564 - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, &rustc_middle[1a40b9d11a76de60]::mir::query::BorrowCheckResult>
  27:     0x7f162b5ad32c - rustc_query_system[259206d12eac588b]::query::plumbing::try_execute_query::<rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt, rustc_query_system[259206d12eac588b]::query::caches::VecCache<rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, &rustc_middle[1a40b9d11a76de60]::mir::query::BorrowCheckResult>>
  28:     0x7f162bf7ef8a - <rustc_query_impl[bc8faa08c5c89942]::Queries as rustc_middle[1a40b9d11a76de60]::ty::query::QueryEngine>::mir_borrowck
  29:     0x7f162b299d21 - <rustc_borrowck[c86664c7788b1f3c]::type_check::TypeChecker>::prove_closure_bounds
  30:     0x7f162b278fc5 - <rustc_borrowck[c86664c7788b1f3c]::type_check::TypeChecker>::typeck_mir
  31:     0x7f162b207c76 - rustc_borrowck[c86664c7788b1f3c]::type_check::type_check
  32:     0x7f162b1d8a35 - rustc_borrowck[c86664c7788b1f3c]::nll::compute_regions
  33:     0x7f162b1bd3ac - rustc_borrowck[c86664c7788b1f3c]::do_mir_borrowck
  34:     0x7f162b1a8c69 - rustc_borrowck[c86664c7788b1f3c]::mir_borrowck
  35:     0x7f162b1a8145 - <rustc_borrowck[c86664c7788b1f3c]::provide::{closure#0} as core[486592e7c49a8aa]::ops::function::FnOnce<(rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::LocalDefId)>>::call_once
  36:     0x7f162b5ae564 - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, &rustc_middle[1a40b9d11a76de60]::mir::query::BorrowCheckResult>
  37:     0x7f162b5ad32c - rustc_query_system[259206d12eac588b]::query::plumbing::try_execute_query::<rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt, rustc_query_system[259206d12eac588b]::query::caches::VecCache<rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, &rustc_middle[1a40b9d11a76de60]::mir::query::BorrowCheckResult>>
  38:     0x7f162bf7ef8a - <rustc_query_impl[bc8faa08c5c89942]::Queries as rustc_middle[1a40b9d11a76de60]::ty::query::QueryEngine>::mir_borrowck
  39:     0x7f162b299d21 - <rustc_borrowck[c86664c7788b1f3c]::type_check::TypeChecker>::prove_closure_bounds
  40:     0x7f162b278fc5 - <rustc_borrowck[c86664c7788b1f3c]::type_check::TypeChecker>::typeck_mir
  41:     0x7f162b207c76 - rustc_borrowck[c86664c7788b1f3c]::type_check::type_check
  42:     0x7f162b1d8a35 - rustc_borrowck[c86664c7788b1f3c]::nll::compute_regions
  43:     0x7f162b1bd3ac - rustc_borrowck[c86664c7788b1f3c]::do_mir_borrowck
  44:     0x7f162b1a8c69 - rustc_borrowck[c86664c7788b1f3c]::mir_borrowck
  45:     0x7f162b1a8145 - <rustc_borrowck[c86664c7788b1f3c]::provide::{closure#0} as core[486592e7c49a8aa]::ops::function::FnOnce<(rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::LocalDefId)>>::call_once
  46:     0x7f162b5ae564 - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, &rustc_middle[1a40b9d11a76de60]::mir::query::BorrowCheckResult>
  47:     0x7f162b5ad32c - rustc_query_system[259206d12eac588b]::query::plumbing::try_execute_query::<rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt, rustc_query_system[259206d12eac588b]::query::caches::VecCache<rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, &rustc_middle[1a40b9d11a76de60]::mir::query::BorrowCheckResult>>
  48:     0x7f162bf7ef8a - <rustc_query_impl[bc8faa08c5c89942]::Queries as rustc_middle[1a40b9d11a76de60]::ty::query::QueryEngine>::mir_borrowck
  49:     0x7f162bdd36f9 - rustc_hir_analysis[1b7141b29bd2e9d]::collect::type_of::type_of
  50:     0x7f162ae90c96 - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::DefId, rustc_middle[1a40b9d11a76de60]::ty::Ty>
  51:     0x7f162ae8e830 - rustc_query_system[259206d12eac588b]::query::plumbing::get_query::<rustc_query_impl[bc8faa08c5c89942]::queries::type_of, rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt>
  52:     0x7f162b6b0460 - rustc_hir_analysis[1b7141b29bd2e9d]::check::check::check_mod_item_types
  53:     0x7f162b149ff4 - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, ()>
  54:     0x7f162b14818e - rustc_query_system[259206d12eac588b]::query::plumbing::try_execute_query::<rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt, rustc_query_system[259206d12eac588b]::query::caches::VecCache<rustc_span[fd000e025c1fef5b]::def_id::LocalDefId, ()>>
  55:     0x7f162b9c1403 - rustc_query_system[259206d12eac588b]::query::plumbing::get_query::<rustc_query_impl[bc8faa08c5c89942]::queries::check_mod_item_types, rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt>
  56:     0x7f162bc6aa55 - <rustc_middle[1a40b9d11a76de60]::hir::map::Map>::for_each_module::<rustc_hir_analysis[1b7141b29bd2e9d]::check_crate::{closure#6}::{closure#0}>
  57:     0x7f162ab50292 - rustc_hir_analysis[1b7141b29bd2e9d]::check_crate
  58:     0x7f162ab4fedb - rustc_interface[58e4822cc60d2a6c]::passes::analysis
  59:     0x7f162bd93e85 - <rustc_query_system[259206d12eac588b]::dep_graph::graph::DepGraph<rustc_middle[1a40b9d11a76de60]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1a40b9d11a76de60]::ty::context::TyCtxt, (), core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  60:     0x7f162bd93048 - rustc_query_system[259206d12eac588b]::query::plumbing::try_execute_query::<rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt, rustc_query_system[259206d12eac588b]::query::caches::DefaultCache<(), core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>>
  61:     0x7f162bd92ab0 - rustc_query_system[259206d12eac588b]::query::plumbing::get_query::<rustc_query_impl[bc8faa08c5c89942]::queries::analysis, rustc_query_impl[bc8faa08c5c89942]::plumbing::QueryCtxt>
  62:     0x7f162b8604f3 - <rustc_interface[58e4822cc60d2a6c]::passes::QueryContext>::enter::<rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  63:     0x7f162b85c8a3 - <rustc_interface[58e4822cc60d2a6c]::interface::Compiler>::enter::<rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}::{closure#2}, core[486592e7c49a8aa]::result::Result<core[486592e7c49a8aa]::option::Option<rustc_interface[58e4822cc60d2a6c]::queries::Linker>, rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  64:     0x7f162b8578b8 - rustc_span[fd000e025c1fef5b]::with_source_map::<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  65:     0x7f162b8573a5 - <scoped_tls[2f862aa259e87453]::ScopedKey<rustc_span[fd000e025c1fef5b]::SessionGlobals>>::set::<rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  66:     0x7f162b856992 - std[14b7645e29e8dad4]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[58e4822cc60d2a6c]::util::run_in_thread_pool_with_globals<rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>
  67:     0x7f162be8dc1a - <<std[14b7645e29e8dad4]::thread::Builder>::spawn_unchecked_<rustc_interface[58e4822cc60d2a6c]::util::run_in_thread_pool_with_globals<rustc_interface[58e4822cc60d2a6c]::interface::run_compiler<core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>, rustc_driver[8fc339cf4408bec4]::run_compiler::{closure#1}>::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[486592e7c49a8aa]::result::Result<(), rustc_errors[5442e185e098f882]::ErrorGuaranteed>>::{closure#1} as core[486592e7c49a8aa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  68:     0x7f162930d983 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdbff13d45d6b3b01
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/alloc/src/boxed.rs:2000:9
  69:     0x7f162930d983 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1e5384a2b7a0037a
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/alloc/src/boxed.rs:2000:9
  70:     0x7f162930d983 - std::sys::unix::thread::Thread::new::thread_start::h4b8540c4f94d9763
                               at /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/library/std/src/sys/unix/thread.rs:108:17
  71:     0x7f162906e8fd - <unknown>
  72:     0x7f16290f0a60 - <unknown>
  73:                0x0 - <unknown>

note: 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: rustc 1.68.0-nightly (0468a00ae 2022-12-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C link-arg=-fuse-ld=/bin/mold

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_borrowck] borrow-checking `<impl at crates/tor-ptmgr/src/lib.rs:120:1: 120:30>::run_one_step::{closure#0}::{closure#1}`
#1 [mir_borrowck] borrow-checking `<impl at crates/tor-ptmgr/src/lib.rs:120:1: 120:30>::run_one_step::{closure#0}`
#2 [mir_borrowck] borrow-checking `<impl at crates/tor-ptmgr/src/lib.rs:120:1: 120:30>::run_one_step`
#3 [type_of] computing type of `<impl at crates/tor-ptmgr/src/lib.rs:120:1: 120:30>::run_one_step::{opaque#0}`
#4 [check_mod_item_types] checking item types in top-level module
#5 [analysis] running analysis passes on this crate
end of query stack

Additional information

I can't reproduce with rustc 1.68.0-nightly (ec56537c4 2022-12-15), but I can with rustc 1.68.0-nightly (9c07efe84 2022-12-16). It seems to be a recent regression

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions