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: type mismatching when copying! #112824

Closed
matthiaskrgr opened this issue Jun 20, 2023 · 2 comments · Fixed by #122863 · May be fixed by #113125
Closed

ice: type mismatching when copying! #112824

matthiaskrgr opened this issue Jun 20, 2023 · 2 comments · Fixed by #122863 · May be fixed by #113125
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. 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

pub struct Opcode(pub u8);

pub struct Opcode2(&'a S);

impl Opcode2 {
    pub const OP2: Opcode2 = Opcode2(Opcode(0x1));
}

pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) {
    move |i| match msg_type {
        Opcode2::OP2 => unimplemented!(),
    }
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (2d0aa5768 2023-06-18)
binary: rustc
commit-hash: 2d0aa57684e10f7b3d3fe740ee18d431181583ad
commit-date: 2023-06-18
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

error[E0261]: use of undeclared lifetime name `'a`
 --> treereduce.out:3:21
  |
3 | pub struct Opcode2(&'a S);
  |                   - ^^ undeclared lifetime
  |                   |
  |                   help: consider introducing lifetime `'a` here: `<'a>`

error[E0412]: cannot find type `S` in this scope
 --> treereduce.out:3:24
  |
3 | pub struct Opcode2(&'a S);
  |                        ^ not found in this scope
  |
help: you might be missing a type parameter
  |
3 | pub struct Opcode2<S>(&'a S);
  |                   +++

error[E0601]: `main` function not found in crate `treereduce`
  --> treereduce.out:13:2
   |
13 | }
   |  ^ consider adding a `main` function to `treereduce.out`
Backtrace

error: internal compiler error: /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/compiler/rustc_const_eval/src/interpret/place.rs:644:13: type mismatch when copying!
                                src: Opcode,
                                dest: &{type error}
 --> treereduce.out:6:30
  |
6 |     pub const OP2: Opcode2 = Opcode2(Opcode(0x1));
  |                              ^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/compiler/rustc_errors/src/lib.rs:994:33
stack backtrace:
   0:     0x7f787d967e11 - std::backtrace_rs::backtrace::libunwind::trace::h184786643c1f8146
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f787d967e11 - std::backtrace_rs::backtrace::trace_unsynchronized::h10cef21dd42edd42
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f787d967e11 - std::sys_common::backtrace::_print_fmt::hca8722c6f82eccd9
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f787d967e11 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4b170c65cdf95c48
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f787d9c94bf - core::fmt::rt::Argument::fmt::h7e50834cab28e102
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/core/src/fmt/rt.rs:138:9
   5:     0x7f787d9c94bf - core::fmt::write::h8bd64fe81f89dd81
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f787d95a977 - std::io::Write::write_fmt::hc75a842b3ecac8bc
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/io/mod.rs:1714:15
   7:     0x7f787d967c25 - std::sys_common::backtrace::_print::hdb7a31bd8c54eb49
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f787d967c25 - std::sys_common::backtrace::print::hbcf968a4222dc0b5
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f787d96a9d3 - std::panicking::default_hook::{{closure}}::h02987b13cfa1387d
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/panicking.rs:269:22
  10:     0x7f787d96a764 - std::panicking::default_hook::hcb3fd44404995c49
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/panicking.rs:288:9
  11:     0x7f7880babd6b - <rustc_driver_impl[7175fdba515aac6e]::install_ice_hook::{closure#0} as core[baaa20f768102eef]::ops::function::FnOnce<(&core[baaa20f768102eef]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f787d96b1fe - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hec1e31de726d1657
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/alloc/src/boxed.rs:2007:9
  13:     0x7f787d96b1fe - std::panicking::rust_panic_with_hook::h223f39091438ac61
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/panicking.rs:709:13
  14:     0x7f7881241861 - std[755122e38bdf80bb]::panicking::begin_panic::<rustc_errors[22c53a0383ffa2c9]::ExplicitBug>::{closure#0}
  15:     0x7f78812400d6 - std[755122e38bdf80bb]::sys_common::backtrace::__rust_end_short_backtrace::<std[755122e38bdf80bb]::panicking::begin_panic<rustc_errors[22c53a0383ffa2c9]::ExplicitBug>::{closure#0}, !>
  16:     0x7f78812555b6 - std[755122e38bdf80bb]::panicking::begin_panic::<rustc_errors[22c53a0383ffa2c9]::ExplicitBug>
  17:     0x7f78812f431e - <rustc_errors[22c53a0383ffa2c9]::HandlerInner>::span_bug::<rustc_span[1e0547ff349d1bca]::span_encoding::Span, alloc[d1ea88cdd25af2a4]::string::String>
  18:     0x7f78812f41ad - <rustc_errors[22c53a0383ffa2c9]::Handler>::span_bug::<rustc_span[1e0547ff349d1bca]::span_encoding::Span, alloc[d1ea88cdd25af2a4]::string::String>
  19:     0x7f788125a0d6 - rustc_middle[56c503886228b671]::util::bug::opt_span_bug_fmt::<rustc_span[1e0547ff349d1bca]::span_encoding::Span>::{closure#0}
  20:     0x7f788125a10a - rustc_middle[56c503886228b671]::ty::context::tls::with_opt::<rustc_middle[56c503886228b671]::util::bug::opt_span_bug_fmt<rustc_span[1e0547ff349d1bca]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f788125782a - rustc_middle[56c503886228b671]::ty::context::tls::with_context_opt::<rustc_middle[56c503886228b671]::ty::context::tls::with_opt<rustc_middle[56c503886228b671]::util::bug::opt_span_bug_fmt<rustc_span[1e0547ff349d1bca]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f787fbb2944 - rustc_middle[56c503886228b671]::util::bug::span_bug_fmt::<rustc_span[1e0547ff349d1bca]::span_encoding::Span>
  23:     0x7f787fb95c71 - <rustc_const_eval[312f54f1179d9c1]::interpret::eval_context::InterpCx<rustc_mir_transform[eaefbefc809602b3]::const_prop::ConstPropMachine>>::eval_rvalue_into_place
  24:     0x7f787fb836e0 - <rustc_mir_transform[eaefbefc809602b3]::const_prop_lint::ConstPropagator as rustc_middle[56c503886228b671]::mir::visit::Visitor>::visit_basic_block_data
  25:     0x7f787fb7a99f - <rustc_mir_transform[eaefbefc809602b3]::const_prop_lint::ConstProp as rustc_mir_transform[eaefbefc809602b3]::pass_manager::MirLint>::run_lint
  26:     0x7f787f1fc946 - rustc_mir_transform[eaefbefc809602b3]::run_analysis_to_runtime_passes
  27:     0x7f787f1f80f5 - rustc_mir_transform[eaefbefc809602b3]::mir_drops_elaborated_and_const_checked
  28:     0x7f787ec3dcee - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  29:     0x7f787ec3dcbe - <rustc_query_impl[e44c98b80a645267]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::LocalDefId)>>::call_once
  30:     0x7f787ecd14cd - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  31:     0x7f78805171ff - rustc_query_impl[e44c98b80a645267]::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7f787fe4d793 - rustc_mir_transform[eaefbefc809602b3]::mir_for_ctfe
  33:     0x7f787ec69406 - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::mir_for_ctfe::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  34:     0x7f787ec693e1 - <rustc_query_impl[e44c98b80a645267]::query_impl::mir_for_ctfe::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::DefId)>>::call_once
  35:     0x7f787ec0cb35 - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::DefaultCache<rustc_span[1e0547ff349d1bca]::def_id::DefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  36:     0x7f7880517302 - rustc_query_impl[e44c98b80a645267]::query_impl::mir_for_ctfe::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7f787f05e8df - <rustc_const_eval[312f54f1179d9c1]::interpret::eval_context::InterpCx<rustc_const_eval[312f54f1179d9c1]::const_eval::machine::CompileTimeInterpreter>>::load_mir
  38:     0x7f787efa70a9 - rustc_const_eval[312f54f1179d9c1]::const_eval::eval_queries::eval_to_allocation_raw_provider
  39:     0x7f787ec5f3d7 - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>
  40:     0x7f787f6f334c - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::DefaultCache<rustc_middle[56c503886228b671]::ty::ParamEnvAnd<rustc_middle[56c503886228b671]::mir::interpret::GlobalId>, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  41:     0x7f787f6f301b - rustc_query_impl[e44c98b80a645267]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  42:     0x7f787efa76f6 - rustc_const_eval[312f54f1179d9c1]::const_eval::eval_queries::eval_to_allocation_raw_provider
  43:     0x7f787ec5f3d7 - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>
  44:     0x7f787f6f334c - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::DefaultCache<rustc_middle[56c503886228b671]::ty::ParamEnvAnd<rustc_middle[56c503886228b671]::mir::interpret::GlobalId>, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  45:     0x7f787f6f301b - rustc_query_impl[e44c98b80a645267]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  46:     0x7f78802f49ef - rustc_const_eval[312f54f1179d9c1]::const_eval::eval_to_valtree
  47:     0x7f78802f4880 - <rustc_const_eval[312f54f1179d9c1]::provide::{closure#0} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_middle[56c503886228b671]::ty::ParamEnvAnd<rustc_middle[56c503886228b671]::mir::interpret::GlobalId>)>>::call_once
  48:     0x7f787ff498f9 - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 24usize]>>
  49:     0x7f787ff498a8 - <rustc_query_impl[e44c98b80a645267]::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_middle[56c503886228b671]::ty::ParamEnvAnd<rustc_middle[56c503886228b671]::mir::interpret::GlobalId>)>>::call_once
  50:     0x7f788018b688 - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::DefaultCache<rustc_middle[56c503886228b671]::ty::ParamEnvAnd<rustc_middle[56c503886228b671]::mir::interpret::GlobalId>, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  51:     0x7f788018b37b - rustc_query_impl[e44c98b80a645267]::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
  52:     0x7f787f29f6fc - rustc_middle[56c503886228b671]::query::plumbing::query_get_at::<rustc_query_system[ba457099f14053e9]::query::caches::DefaultCache<rustc_middle[56c503886228b671]::ty::ParamEnvAnd<rustc_middle[56c503886228b671]::mir::interpret::GlobalId>, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 24usize]>>>
  53:     0x7f787f29f403 - <rustc_middle[56c503886228b671]::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  54:     0x7f787fa00570 - <rustc_mir_build[b29744f53d851e13]::thir::pattern::PatCtxt>::lower_path
  55:     0x7f787f9fc6a8 - <rustc_mir_build[b29744f53d851e13]::thir::pattern::PatCtxt>::lower_pattern
  56:     0x7f787f9fb8ed - <core[baaa20f768102eef]::iter::adapters::map::Map<core[baaa20f768102eef]::slice::iter::Iter<rustc_hir[51d35b3e8e0cb049]::hir::Arm>, <rustc_mir_build[b29744f53d851e13]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}::{closure#14}> as core[baaa20f768102eef]::iter::traits::iterator::Iterator>::fold::<(), core[baaa20f768102eef]::iter::traits::iterator::Iterator::for_each::call<rustc_middle[56c503886228b671]::thir::ArmId, <alloc[d1ea88cdd25af2a4]::vec::Vec<rustc_middle[56c503886228b671]::thir::ArmId>>::extend_trusted<core[baaa20f768102eef]::iter::adapters::map::Map<core[baaa20f768102eef]::slice::iter::Iter<rustc_hir[51d35b3e8e0cb049]::hir::Arm>, <rustc_mir_build[b29744f53d851e13]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}::{closure#14}>>::{closure#0}>::{closure#0}>
  57:     0x7f787f1caa84 - <rustc_mir_build[b29744f53d851e13]::thir::cx::Cx>::make_mirror_unadjusted::{closure#0}
  58:     0x7f787f1c7342 - <rustc_mir_build[b29744f53d851e13]::thir::cx::Cx>::mirror_expr
  59:     0x7f787f4fbded - rustc_mir_build[b29744f53d851e13]::thir::cx::thir_body
  60:     0x7f787ec04f01 - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::thir_body::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>
  61:     0x7f787f471ecb - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  62:     0x7f787f471bf5 - rustc_query_impl[e44c98b80a645267]::query_impl::thir_body::get_query_non_incr::__rust_end_short_backtrace
  63:     0x7f78803d6b04 - rustc_mir_build[b29744f53d851e13]::thir::pattern::check_match::check_match
  64:     0x7f787ebe16ac - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::check_match::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 1usize]>>
  65:     0x7f787f24e61f - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  66:     0x7f787f24e342 - rustc_query_impl[e44c98b80a645267]::query_impl::check_match::get_query_non_incr::__rust_end_short_backtrace
  67:     0x7f787fb6166f - rustc_mir_build[b29744f53d851e13]::build::mir_built
  68:     0x7f787ec0588c - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  69:     0x7f787ec0586e - <rustc_query_impl[e44c98b80a645267]::query_impl::mir_built::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::LocalDefId)>>::call_once
  70:     0x7f787ecd14cd - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  71:     0x7f7880516f0f - rustc_query_impl[e44c98b80a645267]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  72:     0x7f787fd44544 - rustc_mir_transform[eaefbefc809602b3]::check_unsafety::unsafety_check_result
  73:     0x7f787ec058cc - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  74:     0x7f787ec058ae - <rustc_query_impl[e44c98b80a645267]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::LocalDefId)>>::call_once
  75:     0x7f787ecd14cd - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  76:     0x7f7880518baf - rustc_query_impl[e44c98b80a645267]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  77:     0x7f787fd47a50 - rustc_mir_transform[eaefbefc809602b3]::check_unsafety::unsafety_check_result
  78:     0x7f787ec058cc - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::unsafety_check_result::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  79:     0x7f787ec058ae - <rustc_query_impl[e44c98b80a645267]::query_impl::unsafety_check_result::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::LocalDefId)>>::call_once
  80:     0x7f787ecd14cd - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  81:     0x7f7880518baf - rustc_query_impl[e44c98b80a645267]::query_impl::unsafety_check_result::get_query_non_incr::__rust_end_short_backtrace
  82:     0x7f787fe96c24 - rustc_mir_transform[eaefbefc809602b3]::mir_const
  83:     0x7f787ec1264e - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  84:     0x7f787ec1261e - <rustc_query_impl[e44c98b80a645267]::query_impl::mir_const::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::LocalDefId)>>::call_once
  85:     0x7f787ecd14cd - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  86:     0x7f7880516fff - rustc_query_impl[e44c98b80a645267]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  87:     0x7f787ef3013b - rustc_mir_transform[eaefbefc809602b3]::mir_promoted
  88:     0x7f787ec05921 - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>
  89:     0x7f787f471efa - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  90:     0x7f78805173f5 - rustc_query_impl[e44c98b80a645267]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  91:     0x7f787fa1c37c - rustc_borrowck[cf2d7fd60d38cc0f]::mir_borrowck
  92:     0x7f787ec125ee - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  93:     0x7f787ec125be - <rustc_query_impl[e44c98b80a645267]::query_impl::mir_borrowck::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::LocalDefId)>>::call_once
  94:     0x7f787ecd14cd - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
  95:     0x7f78805197ff - rustc_query_impl[e44c98b80a645267]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  96:     0x7f787fd53ee5 - rustc_hir_analysis[eb0d24a920376e7]::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
  97:     0x7f787fd50fef - rustc_hir_analysis[eb0d24a920376e7]::collect::type_of::type_of
  98:     0x7f787ed2635e - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>
  99:     0x7f787ed26090 - <rustc_query_impl[e44c98b80a645267]::query_impl::type_of::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::DefId)>>::call_once
 100:     0x7f787ec0cb35 - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::DefaultCache<rustc_span[1e0547ff349d1bca]::def_id::DefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
 101:     0x7f7880516421 - rustc_query_impl[e44c98b80a645267]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
 102:     0x7f787fc94e66 - rustc_middle[56c503886228b671]::query::plumbing::query_get_at::<rustc_query_system[ba457099f14053e9]::query::caches::DefaultCache<rustc_span[1e0547ff349d1bca]::def_id::DefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 8usize]>>>
 103:     0x7f787fc8cdcf - rustc_hir_analysis[eb0d24a920376e7]::check::check::check_mod_item_types
 104:     0x7f787f81438c - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 0usize]>>
 105:     0x7f787f81436e - <rustc_query_impl[e44c98b80a645267]::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, rustc_span[1e0547ff349d1bca]::def_id::LocalDefId)>>::call_once
 106:     0x7f787f24397f - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::VecCache<rustc_span[1e0547ff349d1bca]::def_id::LocalDefId, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
 107:     0x7f7880521b92 - rustc_query_impl[e44c98b80a645267]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
 108:     0x7f787ffc1187 - <rustc_middle[56c503886228b671]::hir::map::Map>::for_each_module::<rustc_hir_analysis[eb0d24a920376e7]::check_crate::{closure#6}::{closure#0}>
 109:     0x7f787ffc099d - <rustc_session[ebb9057f9195e4cc]::session::Session>::time::<(), rustc_hir_analysis[eb0d24a920376e7]::check_crate::{closure#6}>
 110:     0x7f787ffbee67 - rustc_hir_analysis[eb0d24a920376e7]::check_crate
 111:     0x7f787ffb280a - rustc_interface[e3841d12b9b221e7]::passes::analysis
 112:     0x7f788002350a - rustc_query_impl[e44c98b80a645267]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e44c98b80a645267]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 1usize]>>
 113:     0x7f78800234f9 - <rustc_query_impl[e44c98b80a645267]::query_impl::analysis::dynamic_query::{closure#2} as core[baaa20f768102eef]::ops::function::FnOnce<(rustc_middle[56c503886228b671]::ty::context::TyCtxt, ())>>::call_once
 114:     0x7f788023f0f8 - rustc_query_system[ba457099f14053e9]::query::plumbing::try_execute_query::<rustc_query_impl[e44c98b80a645267]::DynamicConfig<rustc_query_system[ba457099f14053e9]::query::caches::SingleCache<rustc_middle[56c503886228b671]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[e44c98b80a645267]::plumbing::QueryCtxt, false>
 115:     0x7f788023eed7 - rustc_query_impl[e44c98b80a645267]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
 116:     0x7f78800d6115 - <rustc_middle[56c503886228b671]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[7175fdba515aac6e]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[baaa20f768102eef]::result::Result<(), rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>>
 117:     0x7f78800d57bc - <rustc_interface[e3841d12b9b221e7]::interface::Compiler>::enter::<rustc_driver_impl[7175fdba515aac6e]::run_compiler::{closure#1}::{closure#2}, core[baaa20f768102eef]::result::Result<core[baaa20f768102eef]::option::Option<rustc_interface[e3841d12b9b221e7]::queries::Linker>, rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>>
 118:     0x7f78800d2e21 - std[755122e38bdf80bb]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e3841d12b9b221e7]::util::run_in_thread_pool_with_globals<rustc_interface[e3841d12b9b221e7]::interface::run_compiler<core[baaa20f768102eef]::result::Result<(), rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>, rustc_driver_impl[7175fdba515aac6e]::run_compiler::{closure#1}>::{closure#0}, core[baaa20f768102eef]::result::Result<(), rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[baaa20f768102eef]::result::Result<(), rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>>
 119:     0x7f78800d25a5 - <<std[755122e38bdf80bb]::thread::Builder>::spawn_unchecked_<rustc_interface[e3841d12b9b221e7]::util::run_in_thread_pool_with_globals<rustc_interface[e3841d12b9b221e7]::interface::run_compiler<core[baaa20f768102eef]::result::Result<(), rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>, rustc_driver_impl[7175fdba515aac6e]::run_compiler::{closure#1}>::{closure#0}, core[baaa20f768102eef]::result::Result<(), rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[baaa20f768102eef]::result::Result<(), rustc_span[1e0547ff349d1bca]::ErrorGuaranteed>>::{closure#1} as core[baaa20f768102eef]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 120:     0x7f787d975685 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h59d6baf462325ed4
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/alloc/src/boxed.rs:1993:9
 121:     0x7f787d975685 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4eca0dd82537346f
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/alloc/src/boxed.rs:1993:9
 122:     0x7f787d975685 - std::sys::unix::thread::Thread::new::thread_start::h38e13b8ca4256fdb
                               at /rustc/2d0aa57684e10f7b3d3fe740ee18d431181583ad/library/std/src/sys/unix/thread.rs:108:17
 123:     0x7f787d70344b - <unknown>
 124:     0x7f787d786e40 - <unknown>
 125:                0x0 - <unknown>

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.72.0-nightly (2d0aa5768 2023-06-18) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_drops_elaborated_and_const_checked] elaborating drops for `<impl at treereduce.out:5:1: 5:13>::OP2`
#1 [mir_for_ctfe] caching mir of `<impl at treereduce.out:5:1: 5:13>::OP2` for CTFE
#2 [eval_to_allocation_raw] const-evaluating + checking `<impl at treereduce.out:5:1: 5:13>::OP2`
#3 [eval_to_allocation_raw] const-evaluating + checking `<impl at treereduce.out:5:1: 5:13>::OP2`
#4 [eval_to_valtree] evaluating type-level constant
#5 [thir_body] building THIR for `example2::{closure#0}`
#6 [check_match] match-checking `example2::{closure#0}`
#7 [mir_built] building MIR for `example2::{closure#0}`
#8 [unsafety_check_result] unsafety-checking `example2::{closure#0}`
#9 [unsafety_check_result] unsafety-checking `example2`
#10 [mir_const] preparing `example2` for borrow checking
#11 [mir_promoted] promoting constants in MIR for `example2`
#12 [mir_borrowck] borrow-checking `example2`
#13 [type_of] computing type of `example2::{opaque#0}`
#14 [check_mod_item_types] checking item types in top-level module
#15 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0261, E0412, E0601.
For more information about an error, try `rustc --explain E0261`.

@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 Jun 20, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2022-04-18

  commit[0] 2022-04-16: Auto merge of #96123 - Dylan-DPC:rollup-qjog6n1, r=Dylan-DPC
  commit[1] 2022-04-16: Auto merge of #95899 - petrochenkov:modchild2, r=cjgillot
  commit[2] 2022-04-17: Auto merge of #96134 - Dylan-DPC:rollup-ejug3yq, r=Dylan-DPC
  commit[3] 2022-04-17: Auto merge of #96002 - nnethercote:speed-up-Vec-clear-2, r=m-ou-se
  commit[4] 2022-04-17: Auto merge of #96010 - eduardosm:Unique-on-top-of-NonNull, r=m-ou-se,tmiasko
  commit[5] 2022-04-17: Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillot
  commit[6] 2022-04-17: Auto merge of #96016 - Aaron1011:hash-name-cleanup, r=cjgillot
  commit[7] 2022-04-17: Auto merge of #95779 - cjgillot:ast-lifetimes-undeclared, r=petrochenkov
  commit[8] 2022-04-17: Auto merge of #96091 - GuillaumeGomez:duplicated-blanket-impls, r=notriddle
  commit[9] 2022-04-17: Auto merge of #96139 - erikdesjardins:revertinl2, r=Mark-Simulacrum

@JohnTitor
Copy link
Member

Fixed on the latest nightly, marking as E-needs-test (or, feel free to close if we have a sufficient regression test)
@rustbot labels: +E-needs-test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 15, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 22, 2024
@bors bors closed this as completed in d7e166d Mar 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 22, 2024
Rollup merge of rust-lang#122863 - matthiaskrgr:teest, r=lcnr

add more ice tests

fixes rust-lang#119275
fixes rust-lang#113017
fixes rust-lang#112824
fixes rust-lang#112823
fixes rust-lang#121472
fixes rust-lang#110696
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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. 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
4 participants