Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Free regions in optimized MIR when compiling futures-util with -Zmir-opt-level=3 #108720

Closed
saethlin opened this issue Mar 4, 2023 · 0 comments · Fixed by #108787
Closed

Free regions in optimized MIR when compiling futures-util with -Zmir-opt-level=3 #108720

saethlin opened this issue Mar 4, 2023 · 0 comments · Fixed by #108787
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@saethlin
Copy link
Member

saethlin commented Mar 4, 2023

Code

RUSTFLAGS="-Zmir-opt-level=3" cargo +master-stage1 b --release --all-features

building a download of futures-util v0.3.26 (found trying to install the latest cargo-lambda)

Meta

This uh doesn't reproduce on current nightly, because the ICE is from a debug assertion. My master-stage is a stage1 build of commit 44cfafe2fafe816395d3acc434663a45d5178c41, with debug assertions enabled. The assertion is here:

debug_assert!(!body.has_free_regions(), "Free regions in optimized MIR");

Error output

thread 'rustc' panicked at 'Free regions in optimized MIR', compiler/rustc_mir_transform/src/lib.rs:629:5
Backtrace

thread 'rustc' panicked at 'Free regions in optimized MIR', compiler/rustc_mir_transform/src/lib.rs:629:5
stack backtrace:
   0:     0x7f54566eb3c4 - std::backtrace_rs::backtrace::libunwind::trace::h7966bd9c0da533fe
                               at /home/ben/rust-master/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f54566eb3c4 - std::backtrace_rs::backtrace::trace_unsynchronized::h0f0949268ccbbd83
                               at /home/ben/rust-master/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f54566eb3c4 - std::sys_common::backtrace::_print_fmt::h50f4283569f412a0
                               at /home/ben/rust-master/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f54566eb3c4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7c33df3431979079
                               at /home/ben/rust-master/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f5456765d48 - core::fmt::write::h276eb90a7387651c
                               at /home/ben/rust-master/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f54566a56b1 - std::io::Write::write_fmt::hc56f53cfa1ab6df1
                               at /home/ben/rust-master/library/std/src/io/mod.rs:1684:15
   6:     0x7f54566eb1c5 - std::sys_common::backtrace::_print::h3569d071d6e2054e
                               at /home/ben/rust-master/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f54566eb1c5 - std::sys_common::backtrace::print::hc79f4dd4263bba6c
                               at /home/ben/rust-master/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f54566a9234 - std::panicking::default_hook::{{closure}}::h67641bc2b9f937d5
   9:     0x7f54566a8ea1 - std::panicking::default_hook::h954437b49ced1d7c
                               at /home/ben/rust-master/library/std/src/panicking.rs:290:9
  10:     0x7f5457351335 - <alloc[185f63cc1a382ef1]::boxed::Box<dyn for<'a, 'b> core[e6cc6f8dfa096f29]::ops::function::Fn<(&'a core[e6cc6f8dfa096f29]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[e6cc6f8dfa096f29]::marker::Send + core[e6cc6f8dfa096f29]::marker::Sync> as core[e6cc6f8dfa096f29]::ops::function::Fn<(&core[e6cc6f8dfa096f29]::panic::panic_info::PanicInfo,)>>::call
                               at /home/ben/rust-master/library/alloc/src/boxed.rs:2001:9
  11:     0x7f5457351335 - rustc_driver_impl[dfcbfdeaaa914981]::DEFAULT_HOOK::{closure#0}::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_driver_impl/src/lib.rs:1184:17
  12:     0x7f54566a9b35 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hbf7133cd63dbd8f8
                               at /home/ben/rust-master/library/alloc/src/boxed.rs:2001:9
  13:     0x7f54566a9b35 - std::panicking::rust_panic_with_hook::h291538613d1620d6
                               at /home/ben/rust-master/library/std/src/panicking.rs:696:13
  14:     0x7f54566eb6d2 - std::panicking::begin_panic_handler::{{closure}}::h5bd3c8e28be18480
                               at /home/ben/rust-master/library/std/src/panicking.rs:581:13
  15:     0x7f54566eb4dc - std::sys_common::backtrace::__rust_end_short_backtrace::h6f40ed7af405d4c3
                               at /home/ben/rust-master/library/std/src/sys_common/backtrace.rs:150:18
  16:     0x7f54566a9672 - rust_begin_unwind
                               at /home/ben/rust-master/library/std/src/panicking.rs:579:5
  17:     0x7f545667b023 - core::panicking::panic_fmt::h0df763632a2fc469
                               at /home/ben/rust-master/library/core/src/panicking.rs:64:14
  18:     0x7f5457e3b08e - rustc_mir_transform[81f33f476bb0ad54]::inner_optimized_mir
  19:     0x7f5457e3b08e - rustc_mir_transform[81f33f476bb0ad54]::optimized_mir
                               at /home/ben/rust-master/compiler/rustc_mir_transform/src/lib.rs:602:21
  20:     0x7f54592758c1 - <rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir as rustc_query_system[d59f2c6f07b8a38a]::query::config::QueryConfig<rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>>::compute
                               at /home/ben/rust-master/compiler/rustc_query_impl/src/plumbing.rs:505:21
  21:     0x7f54592758c1 - rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job::<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_query_system/src/query/plumbing.rs:421:71
  22:     0x7f54592758c1 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::tlv::with_tlv::<rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:94:9
  23:     0x7f54592758c1 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::enter_context::<rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:114:5
  24:     0x7f54592758c1 - <rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt as rustc_query_system[d59f2c6f07b8a38a]::query::QueryContext>::start_query::<&rustc_middle[3c9de0e076cabeff]::mir::Body, rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_query_impl/src/plumbing.rs:127:13
  25:     0x7f54592758c1 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_related_context::<<rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt as rustc_query_system[d59f2c6f07b8a38a]::query::QueryContext>::start_query<&rustc_middle[3c9de0e076cabeff]::mir::Body, rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:164:9
  26:     0x7f54592758c1 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_context::<rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_related_context<<rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt as rustc_query_system[d59f2c6f07b8a38a]::query::QueryContext>::start_query<&rustc_middle[3c9de0e076cabeff]::mir::Body, rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:142:36
  27:     0x7f54592758c1 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_context_opt::<rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_context<rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_related_context<<rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt as rustc_query_system[d59f2c6f07b8a38a]::query::QueryContext>::start_query<&rustc_middle[3c9de0e076cabeff]::mir::Body, rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:131:18
  28:     0x7f54592758c1 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_context::<rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_related_context<<rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt as rustc_query_system[d59f2c6f07b8a38a]::query::QueryContext>::start_query<&rustc_middle[3c9de0e076cabeff]::mir::Body, rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:142:5
  29:     0x7f54592758c1 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::with_related_context::<<rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt as rustc_query_system[d59f2c6f07b8a38a]::query::QueryContext>::start_query<&rustc_middle[3c9de0e076cabeff]::mir::Body, rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}>::{closure#0}, &rustc_middle[3c9de0e076cabeff]::mir::Body>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:155:5
  30:     0x7f54592758c1 - <rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt as rustc_query_system[d59f2c6f07b8a38a]::query::QueryContext>::start_query::<&rustc_middle[3c9de0e076cabeff]::mir::Body, rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>::{closure#0}>
                               at /home/ben/rust-master/compiler/rustc_query_impl/src/plumbing.rs:112:9
  31:     0x7f54592758c1 - rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::execute_job::<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>
                               at /home/ben/rust-master/compiler/rustc_query_system/src/query/plumbing.rs:421:22
  32:     0x7f54592758c1 - rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::try_execute_query::<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt>
                               at /home/ben/rust-master/compiler/rustc_query_system/src/query/plumbing.rs:365:44
  33:     0x7f5458f5b17a - rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::get_query::<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt, rustc_middle[3c9de0e076cabeff]::dep_graph::dep_node::DepKind>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_query_system/src/query/plumbing.rs:750:36
  34:     0x7f5458f5b17a - stacker[6c4b829cc070632a]::maybe_grow::<(&rustc_middle[3c9de0e076cabeff]::mir::Body, core[e6cc6f8dfa096f29]::option::Option<rustc_query_system[d59f2c6f07b8a38a]::dep_graph::graph::DepNodeIndex>), rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::get_query<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt, rustc_middle[3c9de0e076cabeff]::dep_graph::dep_node::DepKind>::{closure#0}>
                               at /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.15/src/lib.rs:55:9
  35:     0x7f5458f5b17a - rustc_data_structures[9eb96948a4ae89da]::stack::ensure_sufficient_stack::<(&rustc_middle[3c9de0e076cabeff]::mir::Body, core[e6cc6f8dfa096f29]::option::Option<rustc_query_system[d59f2c6f07b8a38a]::dep_graph::graph::DepNodeIndex>), rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::get_query<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt, rustc_middle[3c9de0e076cabeff]::dep_graph::dep_node::DepKind>::{closure#0}>
                               at /home/ben/rust-master/compiler/rustc_data_structures/src/stack.rs:17:5
  36:     0x7f5458f5b17a - rustc_query_system[d59f2c6f07b8a38a]::query::plumbing::get_query::<rustc_query_impl[bd6e71e139dc9f0a]::queries::optimized_mir, rustc_query_impl[bd6e71e139dc9f0a]::plumbing::QueryCtxt, rustc_middle[3c9de0e076cabeff]::dep_graph::dep_node::DepKind>
                               at /home/ben/rust-master/compiler/rustc_query_system/src/query/plumbing.rs:750:9
  37:     0x7f5458f5b17a - <rustc_query_impl[bd6e71e139dc9f0a]::Queries as rustc_middle[3c9de0e076cabeff]::ty::query::QueryEngine>::optimized_mir::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_query_impl/src/plumbing.rs:742:17
  38:     0x7f5458f5b17a - <rustc_query_impl[bd6e71e139dc9f0a]::Queries as rustc_middle[3c9de0e076cabeff]::ty::query::QueryEngine>::optimized_mir
                               at /home/ben/rust-master/compiler/rustc_query_impl/src/lib.rs:46:1
  39:     0x7f5459959c79 - <rustc_middle[3c9de0e076cabeff]::ty::query::TyCtxtAt>::optimized_mir::<rustc_span[81fb46c8d825f89f]::def_id::LocalDefId>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/query.rs:310:29
  40:     0x7f5459959c79 - <rustc_middle[3c9de0e076cabeff]::ty::context::TyCtxt>::optimized_mir::<rustc_span[81fb46c8d825f89f]::def_id::LocalDefId>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/query.rs:296:35
  41:     0x7f5459959c79 - <rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::EncodeContext>::encode_mir
                               at /home/ben/rust-master/compiler/rustc_metadata/src/rmeta/encoder.rs:1404:78
  42:     0x7f5459959c79 - <rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::EncodeContext>::encode_crate_root::{closure#14}
                               at /home/ben/rust-master/compiler/rustc_metadata/src/rmeta/encoder.rs:610:29
  43:     0x7f5459959c79 - <rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::EncodeContext>::encode_crate_root
                               at /home/ben/rust-master/compiler/rustc_metadata/src/rmeta/encoder.rs:610:13
  44:     0x7f545996cccc - rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::encode_metadata_impl
                               at /home/ben/rust-master/compiler/rustc_metadata/src/rmeta/encoder.rs:2195:16
  45:     0x7f545984d859 - rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::encode_metadata::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_metadata/src/rmeta/encoder.rs:2146:12
  46:     0x7f545984d859 - rustc_data_structures[9eb96948a4ae89da]::sync::join::<rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
                               at /home/ben/rust-master/compiler/rustc_data_structures/src/sync.rs:121:14
  47:     0x7f545996c0b3 - rustc_metadata[b464f6c3a9ed8a3e]::rmeta::encoder::encode_metadata
                               at /home/ben/rust-master/compiler/rustc_metadata/src/rmeta/encoder.rs:2145:5
  48:     0x7f545991155d - rustc_metadata[b464f6c3a9ed8a3e]::fs::encode_and_write_metadata
                               at /home/ben/rust-master/compiler/rustc_metadata/src/fs.rs:86:13
  49:     0x7f5457461ac6 - rustc_interface[5037f0077237394]::passes::start_codegen
                               at /home/ben/rust-master/compiler/rustc_interface/src/passes.rs:865:44
  50:     0x7f5457464da7 - <rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:243:20
  51:     0x7f5457464da7 - <rustc_middle[3c9de0e076cabeff]::ty::context::GlobalCtxt>::enter::<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context.rs:555:37
  52:     0x7f5457464da7 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::tlv::with_tlv::<<rustc_middle[3c9de0e076cabeff]::ty::context::GlobalCtxt>::enter<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:94:9
  53:     0x7f5457464da7 - rustc_middle[3c9de0e076cabeff]::ty::context::tls::enter_context::<<rustc_middle[3c9de0e076cabeff]::ty::context::GlobalCtxt>::enter<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context/tls.rs:114:5
  54:     0x7f5457464da7 - <rustc_middle[3c9de0e076cabeff]::ty::context::GlobalCtxt>::enter::<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/rust-master/compiler/rustc_middle/src/ty/context.rs:555:9
  55:     0x7f545743c444 - <rustc_interface[5037f0077237394]::queries::QueryResult<&rustc_middle[3c9de0e076cabeff]::ty::context::GlobalCtxt>>::enter::<core[e6cc6f8dfa096f29]::result::Result<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, <rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}>
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:71:9
  56:     0x7f545743c444 - <rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:230:13
  57:     0x7f545743c444 - <rustc_interface[5037f0077237394]::queries::Query<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>>::compute::<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}>::{closure#0}::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:45:41
  58:     0x7f545743c444 - <core[e6cc6f8dfa096f29]::option::Option<core[e6cc6f8dfa096f29]::result::Result<rustc_data_structures[9eb96948a4ae89da]::steal::Steal<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>>::get_or_insert_with::<<rustc_interface[5037f0077237394]::queries::Query<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>>::compute<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}>::{closure#0}::{closure#0}>
                               at /home/ben/rust-master/library/core/src/option.rs:1712:49
  59:     0x7f545743c444 - <rustc_interface[5037f0077237394]::queries::Query<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>>::compute::<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:45:17
  60:     0x7f545743c444 - <core[e6cc6f8dfa096f29]::cell::RefMut<core[e6cc6f8dfa096f29]::option::Option<core[e6cc6f8dfa096f29]::result::Result<rustc_data_structures[9eb96948a4ae89da]::steal::Steal<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>>>::filter_map::<rustc_data_structures[9eb96948a4ae89da]::steal::Steal<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>, <rustc_interface[5037f0077237394]::queries::Query<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>>::compute<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}>::{closure#0}>
                               at /home/ben/rust-master/library/core/src/cell.rs:1588:15
  61:     0x7f545743c444 - <rustc_interface[5037f0077237394]::queries::Query<alloc[185f63cc1a382ef1]::boxed::Box<dyn core[e6cc6f8dfa096f29]::any::Any>>>::compute::<<rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen::{closure#0}>
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:42:9
  62:     0x7f545743c444 - <rustc_interface[5037f0077237394]::queries::Queries>::ongoing_codegen
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:229:9
  63:     0x7f54573a3434 - rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}::{closure#2}
                               at /home/ben/rust-master/compiler/rustc_driver_impl/src/lib.rs:391:13
  64:     0x7f54573a3434 - <rustc_interface[5037f0077237394]::interface::Compiler>::enter::<rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}::{closure#2}, core[e6cc6f8dfa096f29]::result::Result<core[e6cc6f8dfa096f29]::option::Option<rustc_interface[5037f0077237394]::queries::Linker>, rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/rust-master/compiler/rustc_interface/src/queries.rs:368:19
  65:     0x7f54573a3434 - rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}
                               at /home/ben/rust-master/compiler/rustc_driver_impl/src/lib.rs:327:22
  66:     0x7f54573a3434 - rustc_interface[5037f0077237394]::interface::run_compiler::<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_interface/src/interface.rs:301:21
  67:     0x7f54573a3434 - rustc_span[81fb46c8d825f89f]::with_source_map::<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
                               at /home/ben/rust-master/compiler/rustc_span/src/lib.rs:1027:5
  68:     0x7f545738fb88 - rustc_interface[5037f0077237394]::interface::run_compiler::<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_interface/src/interface.rs:295:13
  69:     0x7f545738fb88 - <scoped_tls[669fbe28a36a1627]::ScopedKey<rustc_span[81fb46c8d825f89f]::SessionGlobals>>::set::<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  70:     0x7f545735f1f0 - rustc_span[81fb46c8d825f89f]::create_session_globals_then::<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}>
                               at /home/ben/rust-master/compiler/rustc_span/src/lib.rs:112:5
  71:     0x7f545735f1f0 - rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals::<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}
                               at /home/ben/rust-master/compiler/rustc_interface/src/util.rs:152:38
  72:     0x7f545735f1f0 - std[7eb1f25088cfe367]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/rust-master/library/std/src/sys_common/backtrace.rs:134:18
  73:     0x7f5457363f73 - <std[7eb1f25088cfe367]::thread::Builder>::spawn_unchecked_::<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#1}::{closure#0}
                               at /home/ben/rust-master/library/std/src/thread/mod.rs:560:17
  74:     0x7f5457363f73 - <core[e6cc6f8dfa096f29]::panic::unwind_safe::AssertUnwindSafe<<std[7eb1f25088cfe367]::thread::Builder>::spawn_unchecked_<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#1}::{closure#0}> as core[e6cc6f8dfa096f29]::ops::function::FnOnce<()>>::call_once
                               at /home/ben/rust-master/library/core/src/panic/unwind_safe.rs:271:9
  75:     0x7f5457363f73 - std[7eb1f25088cfe367]::panicking::try::do_call::<core[e6cc6f8dfa096f29]::panic::unwind_safe::AssertUnwindSafe<<std[7eb1f25088cfe367]::thread::Builder>::spawn_unchecked_<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/rust-master/library/std/src/panicking.rs:487:40
  76:     0x7f5457363f73 - std[7eb1f25088cfe367]::panicking::try::<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, core[e6cc6f8dfa096f29]::panic::unwind_safe::AssertUnwindSafe<<std[7eb1f25088cfe367]::thread::Builder>::spawn_unchecked_<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
                               at /home/ben/rust-master/library/std/src/panicking.rs:451:19
  77:     0x7f5457363f73 - std[7eb1f25088cfe367]::panic::catch_unwind::<core[e6cc6f8dfa096f29]::panic::unwind_safe::AssertUnwindSafe<<std[7eb1f25088cfe367]::thread::Builder>::spawn_unchecked_<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>
                               at /home/ben/rust-master/library/std/src/panic.rs:140:14
  78:     0x7f5457363f73 - <std[7eb1f25088cfe367]::thread::Builder>::spawn_unchecked_::<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#1}
                               at /home/ben/rust-master/library/std/src/thread/mod.rs:559:30
  79:     0x7f5457363f73 - <<std[7eb1f25088cfe367]::thread::Builder>::spawn_unchecked_<rustc_interface[5037f0077237394]::util::run_in_thread_pool_with_globals<rustc_interface[5037f0077237394]::interface::run_compiler<core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>, rustc_driver_impl[dfcbfdeaaa914981]::run_compiler::{closure#1}>::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e6cc6f8dfa096f29]::result::Result<(), rustc_span[81fb46c8d825f89f]::ErrorGuaranteed>>::{closure#1} as core[e6cc6f8dfa096f29]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                               at /home/ben/rust-master/library/core/src/ops/function.rs:250:5
  80:     0x7f54566a3528 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h14eced52fe478e0e
                               at /home/ben/rust-master/library/alloc/src/boxed.rs:1987:9
  81:     0x7f54566a3528 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h62f3eb9114f54e55
                               at /home/ben/rust-master/library/alloc/src/boxed.rs:1987:9
  82:     0x7f545668cf35 - std::sys::unix::thread::Thread::new::thread_start::h2516933a72271431
                               at /home/ben/rust-master/library/std/src/sys/unix/thread.rs:108:17
  83:     0x7f545689ebb5 - <unknown>
  84:     0x7f5456920d90 - <unknown>
  85:                0x0 - <unknown>

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: rustc 1.69.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -Z mir-opt-level=3

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `future::future::remote_handle::<impl at src/future/future/remote_handle.rs:92:1: 92:41>::poll`
end of query stack
error: could not compile `futures-util`

@saethlin saethlin added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way labels Mar 4, 2023
@bors bors closed this as completed in ac4379f Mar 6, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 6, 2023
…-obk

Check for free regions in MIR validation

This turns rust-lang#108720 into a MIR validation failure that will reproduce without debug-assertions enabled.

```
error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:296 ~ futures_util[3805]::future::future::remote_handle::{impl#3}::poll), const_param_did: None }) (after pass ScalarReplacementOfAggregates) at bb0[0]:
                                Free regions in optimized runtime-post-cleanup MIR
  --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.26/src/future/future/remote_handle.rs:96:13
   |
96 |         let this = self.project();
   |             ^^^^
```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 6, 2023
…-obk

Check for free regions in MIR validation

This turns rust-lang#108720 into a MIR validation failure that will reproduce without debug-assertions enabled.

```
error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:296 ~ futures_util[3805]::future::future::remote_handle::{impl#3}::poll), const_param_did: None }) (after pass ScalarReplacementOfAggregates) at bb0[0]:
                                Free regions in optimized runtime-post-cleanup MIR
  --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.26/src/future/future/remote_handle.rs:96:13
   |
96 |         let this = self.project();
   |             ^^^^
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant