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

ice when running async in miri: const variables should not be hashed: Var(_#0c) with -Zdrop-tracking #105981

Closed
matthiaskrgr opened this issue Dec 21, 2022 · 1 comment · Fixed by #105983
Assignees
Labels
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.

Comments

@matthiaskrgr
Copy link
Member

Code

Code from #104787

use core::array;

use futures_concurrency::prelude::*;
use futures_lite::{future::block_on, stream, StreamExt};

fn main() {
    block_on(async {
        // works, the array length is known
        // let s = from_fn::<_, 5, _>(stream::once)
        let s = array::from_fn(stream::once)
            .merge()
            .fold(0, |acc, n| acc + n)
            .await;

        assert_eq!(10, s);
    });
}

Cargo toml:

[package]
name = "miri_ice"
version = "0.1.0"
edition = "2021" # need new edition

[dependencies]
futures-concurrency = "*"
futures-lite = "*"

Put code into src/main and RUSTFLAGS="-Zdrop-tracking" cargo miri run (drop tracking does seem to be crucial here for some reason)

Meta

rustc --version --verbose:

rustc 1.68.0-nightly (935dc0721 2022-12-19)
binary: rustc
commit-hash: 935dc07218b4bf6e20231e44eb9263b612fd649b
commit-date: 2022-12-19
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

<output>
Backtrace

     Running `/home/matthias/.rustup/toolchains/master/bin/cargo-miri runner target/miri/x86_64-unknown-linux-gnu/debug/miri_ice`
thread 'rustc' panicked at 'const variables should not be hashed: Var(_#0c)', /rustc/d6da428f343ab811b2b132364360ba13ff05830c/compiler/rustc_middle/src/ty/consts/kind.rs:145:35
stack backtrace:
   0:     0x7f416c765a7a - std::backtrace_rs::backtrace::libunwind::trace::h43f263a5870e5b32
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f416c765a7a - std::backtrace_rs::backtrace::trace_unsynchronized::hee997e8e8ac3213d
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f416c765a7a - std::sys_common::backtrace::_print_fmt::hf8689e558f12c7e4
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f416c765a7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf0e11f0d015294ad
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f416c7c87ae - core::fmt::write::h066e97d9e1fa23e8
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f416c755e45 - std::io::Write::write_fmt::h6ccd43978f9803af
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/io/mod.rs:1682:15
   6:     0x7f416c765845 - std::sys_common::backtrace::_print::h2aaa89027846495b
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f416c765845 - std::sys_common::backtrace::print::h00d4ef82f2717419
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f416c76858f - std::panicking::default_hook::{{closure}}::h168f4f446d26243b
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:267:22
   9:     0x7f416c7682cb - std::panicking::default_hook::h4eb1d25bed66eaea
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:286:9
  10:     0x7f416fa3ebb1 - rustc_driver[7f25dd96324c832f]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f416c768dcd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h9dbd8d42f389e8e1
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/alloc/src/boxed.rs:2032:9
  12:     0x7f416c768dcd - std::panicking::rust_panic_with_hook::h78df6de09193d341
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:692:13
  13:     0x7f416c768b49 - std::panicking::begin_panic_handler::{{closure}}::h3bb65869fb861284
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:579:13
  14:     0x7f416c765f2c - std::sys_common::backtrace::__rust_end_short_backtrace::h5f3d5250effb6f2c
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7f416c768852 - rust_begin_unwind
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:575:5
  16:     0x7f416c7c5193 - core::panicking::panic_fmt::h72fa6a9f0d1db5bd
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/core/src/panicking.rs:64:14
  17:     0x7f4170328ad0 - <rustc_middle[f61a2b1647824cd3]::ty::consts::kind::InferConst as rustc_data_structures[74537ac9c16d9585]::stable_hasher::HashStable<rustc_query_system[527ff4155252de95]::ich::hcx::StableHashingContext>>::hash_stable
  18:     0x7f416df6ff83 - <rustc_type_ir[f1c9c85c61d71dd5]::ty_info::WithCachedTypeInfo<rustc_type_ir[f1c9c85c61d71dd5]::sty::TyKind<rustc_middle[f61a2b1647824cd3]::ty::context::TyCtxt>> as rustc_data_structures[74537ac9c16d9585]::stable_hasher::HashStable<rustc_query_system[527ff4155252de95]::ich::hcx::StableHashingContext>>::hash_stable
  19:     0x7f416e3ffa27 - <rustc_query_system[527ff4155252de95]::dep_graph::dep_node::DepNode<rustc_middle[f61a2b1647824cd3]::dep_graph::dep_node::DepKind>>::construct::<rustc_middle[f61a2b1647824cd3]::ty::context::TyCtxt, rustc_middle[f61a2b1647824cd3]::ty::Ty>
  20:     0x7f416e3feba6 - rustc_query_system[527ff4155252de95]::query::plumbing::try_execute_query::<rustc_query_impl[44daf3341241e6a3]::plumbing::QueryCtxt, rustc_query_system[527ff4155252de95]::query::caches::DefaultCache<rustc_middle[f61a2b1647824cd3]::ty::Ty, rustc_middle[f61a2b1647824cd3]::ty::inhabitedness::inhabited_predicate::InhabitedPredicate>>
  21:     0x7f416dd78d21 - <rustc_middle[f61a2b1647824cd3]::ty::Ty>::is_inhabited_from
  22:     0x7f416fc618d4 - <rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor>::handle_uninhabited_return
  23:     0x7f416fc621b5 - <rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor as rustc_hir[c2f1e79ccee0de2d]::intravisit::Visitor>::visit_expr
  24:     0x7f416fc62147 - <rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor as rustc_hir[c2f1e79ccee0de2d]::intravisit::Visitor>::visit_expr
  25:     0x7f416fc62147 - <rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor as rustc_hir[c2f1e79ccee0de2d]::intravisit::Visitor>::visit_expr
  26:     0x7f416fc621a1 - <rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor as rustc_hir[c2f1e79ccee0de2d]::intravisit::Visitor>::visit_expr
  27:     0x7f416fc61e9e - <rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor as rustc_hir[c2f1e79ccee0de2d]::intravisit::Visitor>::visit_expr
  28:     0x7f416fbf396c - rustc_hir[c2f1e79ccee0de2d]::intravisit::walk_local::<rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor>
  29:     0x7f416fbf367a - rustc_hir[c2f1e79ccee0de2d]::intravisit::walk_block::<rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor>
  30:     0x7f416fc61a35 - <rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::DropRangeVisitor as rustc_hir[c2f1e79ccee0de2d]::intravisit::Visitor>::visit_expr
  31:     0x7f416fc616bc - rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::cfg_build::build_control_flow_graph
  32:     0x7f416fc26b06 - rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::drop_ranges::compute_drop_ranges
  33:     0x7f416fc4b813 - rustc_hir_typeck[70da2d71fd8284ba]::generator_interior::resolve_interior
  34:     0x7f416df78155 - <rustc_hir_typeck[70da2d71fd8284ba]::inherited::InheritedBuilder>::enter::<rustc_hir_typeck[70da2d71fd8284ba]::typeck_with_fallback<rustc_hir_typeck[70da2d71fd8284ba]::typeck::{closure#0}>::{closure#0}::{closure#1}, &rustc_middle[f61a2b1647824cd3]::ty::typeck_results::TypeckResults>
  35:     0x7f416df68ab1 - rustc_hir_typeck[70da2d71fd8284ba]::typeck
  36:     0x7f416df72f14 - <rustc_query_system[527ff4155252de95]::dep_graph::graph::DepGraph<rustc_middle[f61a2b1647824cd3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[f61a2b1647824cd3]::ty::context::TyCtxt, rustc_span[37405074fe34104d]::def_id::LocalDefId, &rustc_middle[f61a2b1647824cd3]::ty::typeck_results::TypeckResults>
  37:     0x7f416df67361 - rustc_query_system[527ff4155252de95]::query::plumbing::try_execute_query::<rustc_query_impl[44daf3341241e6a3]::plumbing::QueryCtxt, rustc_query_system[527ff4155252de95]::query::caches::VecCache<rustc_span[37405074fe34104d]::def_id::LocalDefId, &rustc_middle[f61a2b1647824cd3]::ty::typeck_results::TypeckResults>>
  38:     0x7f416f1b1d75 - rustc_data_structures[74537ac9c16d9585]::sync::par_for_each_in::<&[rustc_span[37405074fe34104d]::def_id::LocalDefId], <rustc_middle[f61a2b1647824cd3]::hir::map::Map>::par_body_owners<rustc_hir_typeck[70da2d71fd8284ba]::typeck_item_bodies::{closure#0}>::{closure#0}>
  39:     0x7f416f1b1ab3 - rustc_hir_typeck[70da2d71fd8284ba]::typeck_item_bodies
  40:     0x7f416f09e827 - <rustc_query_system[527ff4155252de95]::dep_graph::graph::DepGraph<rustc_middle[f61a2b1647824cd3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[f61a2b1647824cd3]::ty::context::TyCtxt, (), ()>
  41:     0x7f416f09d660 - rustc_query_system[527ff4155252de95]::query::plumbing::try_execute_query::<rustc_query_impl[44daf3341241e6a3]::plumbing::QueryCtxt, rustc_query_system[527ff4155252de95]::query::caches::DefaultCache<(), ()>>
  42:     0x7f416f09cfe0 - rustc_query_system[527ff4155252de95]::query::plumbing::get_query::<rustc_query_impl[44daf3341241e6a3]::queries::typeck_item_bodies, rustc_query_impl[44daf3341241e6a3]::plumbing::QueryCtxt>
  43:     0x7f416dfd1d12 - <rustc_session[291424b820899e52]::session::Session>::time::<(), rustc_hir_analysis[4e333297774f6f82]::check_crate::{closure#7}>
  44:     0x7f416dfd0c0c - rustc_hir_analysis[4e333297774f6f82]::check_crate
  45:     0x7f416dfd082b - rustc_interface[2b0fbf2727e40701]::passes::analysis
  46:     0x7f416f2061e5 - <rustc_query_system[527ff4155252de95]::dep_graph::graph::DepGraph<rustc_middle[f61a2b1647824cd3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[f61a2b1647824cd3]::ty::context::TyCtxt, (), core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>
  47:     0x7f416f2053a8 - rustc_query_system[527ff4155252de95]::query::plumbing::try_execute_query::<rustc_query_impl[44daf3341241e6a3]::plumbing::QueryCtxt, rustc_query_system[527ff4155252de95]::query::caches::DefaultCache<(), core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>>
  48:     0x7f416f204e10 - rustc_query_system[527ff4155252de95]::query::plumbing::get_query::<rustc_query_impl[44daf3341241e6a3]::queries::analysis, rustc_query_impl[44daf3341241e6a3]::plumbing::QueryCtxt>
  49:     0x7f416eceecb3 - <rustc_interface[2b0fbf2727e40701]::passes::QueryContext>::enter::<rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>
  50:     0x7f416eceb063 - <rustc_interface[2b0fbf2727e40701]::interface::Compiler>::enter::<rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}::{closure#2}, core[706d23e1e253327f]::result::Result<core[706d23e1e253327f]::option::Option<rustc_interface[2b0fbf2727e40701]::queries::Linker>, rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>
  51:     0x7f416ece6078 - rustc_span[37405074fe34104d]::with_source_map::<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  52:     0x7f416ece5b65 - <scoped_tls[5f1c7b8ea42fa458]::ScopedKey<rustc_span[37405074fe34104d]::SessionGlobals>>::set::<rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>
  53:     0x7f416ece5152 - std[c68000344552a71]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2b0fbf2727e40701]::util::run_in_thread_pool_with_globals<rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>
  54:     0x7f416f2fe52a - <<std[c68000344552a71]::thread::Builder>::spawn_unchecked_<rustc_interface[2b0fbf2727e40701]::util::run_in_thread_pool_with_globals<rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>::{closure#1} as core[706d23e1e253327f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  55:     0x7f416c772dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h35e61239b05cc96a
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/alloc/src/boxed.rs:2000:9
  56:     0x7f416c772dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he904b5a1cef2a94a
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/alloc/src/boxed.rs:2000:9
  57:     0x7f416c772dc3 - std::sys::unix::thread::Thread::new::thread_start::h39c7a296eadb90d7
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys/unix/thread.rs:108:17
  58:     0x7f416c41d8fd - <unknown>
  59:     0x7f416c49fa60 - <unknown>
  60:                0x0 - <unknown>

error: internal compiler error: unexpected panic

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 (d6da428f3 2022-12-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -Z drop-tracking

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

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: could not resolve infer vars in `[futures_lite::stream::Once<usize>; _]`
  --> src/main.rs:10:17
   |
10 |         let s = array::from_fn(stream::once)
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: delayed at compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/cfg_build.rs:235:18

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1610:13
stack backtrace:
   0:     0x7f416c765a7a - std::backtrace_rs::backtrace::libunwind::trace::h43f263a5870e5b32
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f416c765a7a - std::backtrace_rs::backtrace::trace_unsynchronized::hee997e8e8ac3213d
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f416c765a7a - std::sys_common::backtrace::_print_fmt::hf8689e558f12c7e4
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f416c765a7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf0e11f0d015294ad
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f416c7c87ae - core::fmt::write::h066e97d9e1fa23e8
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f416c755e45 - std::io::Write::write_fmt::h6ccd43978f9803af
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/io/mod.rs:1682:15
   6:     0x7f416c765845 - std::sys_common::backtrace::_print::h2aaa89027846495b
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f416c765845 - std::sys_common::backtrace::print::h00d4ef82f2717419
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f416c76858f - std::panicking::default_hook::{{closure}}::h168f4f446d26243b
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:267:22
   9:     0x7f416c7682cb - std::panicking::default_hook::h4eb1d25bed66eaea
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:286:9
  10:     0x7f416fa3ebb1 - rustc_driver[7f25dd96324c832f]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f416c768dcd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h9dbd8d42f389e8e1
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/alloc/src/boxed.rs:2032:9
  12:     0x7f416c768dcd - std::panicking::rust_panic_with_hook::h78df6de09193d341
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/panicking.rs:692:13
  13:     0x7f416fa77b81 - std[c68000344552a71]::panicking::begin_panic::<rustc_errors[c39c6d506d8519f6]::ExplicitBug>::{closure#0}
  14:     0x7f416fa76456 - std[c68000344552a71]::sys_common::backtrace::__rust_end_short_backtrace::<std[c68000344552a71]::panicking::begin_panic<rustc_errors[c39c6d506d8519f6]::ExplicitBug>::{closure#0}, !>
  15:     0x7f416fa54146 - std[c68000344552a71]::panicking::begin_panic::<rustc_errors[c39c6d506d8519f6]::ExplicitBug>
  16:     0x7f416fa73926 - std[c68000344552a71]::panic::panic_any::<rustc_errors[c39c6d506d8519f6]::ExplicitBug>
  17:     0x7f416ef2ce46 - <rustc_errors[c39c6d506d8519f6]::HandlerInner>::flush_delayed::<alloc[84461028580bbcc9]::vec::Vec<rustc_errors[c39c6d506d8519f6]::diagnostic::Diagnostic>, &str>
  18:     0x7f416ef2c14b - <rustc_errors[c39c6d506d8519f6]::HandlerInner as core[706d23e1e253327f]::ops::drop::Drop>::drop
  19:     0x7f416ecf837e - core[706d23e1e253327f]::ptr::drop_in_place::<rustc_session[291424b820899e52]::parse::ParseSess>
  20:     0x7f416ece742f - core[706d23e1e253327f]::ptr::drop_in_place::<rustc_session[291424b820899e52]::session::Session>
  21:     0x7f416ece7160 - core[706d23e1e253327f]::ptr::drop_in_place::<rustc_interface[2b0fbf2727e40701]::interface::Compiler>
  22:     0x7f416ece6538 - rustc_span[37405074fe34104d]::with_source_map::<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  23:     0x7f416ece5b65 - <scoped_tls[5f1c7b8ea42fa458]::ScopedKey<rustc_span[37405074fe34104d]::SessionGlobals>>::set::<rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>
  24:     0x7f416ece5152 - std[c68000344552a71]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2b0fbf2727e40701]::util::run_in_thread_pool_with_globals<rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>
  25:     0x7f416f2fe52a - <<std[c68000344552a71]::thread::Builder>::spawn_unchecked_<rustc_interface[2b0fbf2727e40701]::util::run_in_thread_pool_with_globals<rustc_interface[2b0fbf2727e40701]::interface::run_compiler<core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>, rustc_driver[7f25dd96324c832f]::run_compiler::{closure#1}>::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[706d23e1e253327f]::result::Result<(), rustc_errors[c39c6d506d8519f6]::ErrorGuaranteed>>::{closure#1} as core[706d23e1e253327f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  26:     0x7f416c772dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h35e61239b05cc96a
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/alloc/src/boxed.rs:2000:9
  27:     0x7f416c772dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he904b5a1cef2a94a
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/alloc/src/boxed.rs:2000:9
  28:     0x7f416c772dc3 - std::sys::unix::thread::Thread::new::thread_start::h39c7a296eadb90d7
                               at /rustc/d6da428f343ab811b2b132364360ba13ff05830c/library/std/src/sys/unix/thread.rs:108:17
  29:     0x7f416c41d8fd - <unknown>
  30:     0x7f416c49fa60 - <unknown>
  31:                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 (d6da428f3 2022-12-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -Z drop-tracking

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
[2]    3192648 IOT instruction (core dumped)  RUSTFLAGS="-Zdrop-tracking" ~/.cargo/bin/cargo +master miri run

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Dec 21, 2022
@compiler-errors
Copy link
Member

This isn't a miri ICE, the same project fails with cargo rustc -- -Zdrop-tracking.

@compiler-errors compiler-errors self-assigned this Dec 21, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 22, 2022
…iasko

Add a missing early return in drop tracking `handle_uninhabited_return`

This return is needed so we don't call `Ty::is_inhabited_from` from a type with ty/ct vars in it.

Fixes rust-lang#105981
@bors bors closed this as completed in 273fe60 Dec 23, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
…iasko

Add a missing early return in drop tracking `handle_uninhabited_return`

This return is needed so we don't call `Ty::is_inhabited_from` from a type with ty/ct vars in it.

Fixes rust-lang#105981
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) ❄️ 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.

2 participants