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: invalid asymmetric binary op #121858

Closed
matthiaskrgr opened this issue Mar 1, 2024 · 2 comments · Fixed by #125451
Closed

ICE: invalid asymmetric binary op #121858

matthiaskrgr opened this issue Mar 1, 2024 · 2 comments · Fixed by #125451
Labels
A-const-eval Area: Constant evaluation (MIR interpretation) C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

#![feature(generic_const_exprs)]

struct Outer<const A: i64, const B: usize>();
impl<const A: usize, const B: usize> Outer<A, B>
where
    [(); A + (B * 2)]:,
{
    fn o() -> Union {}
}

fn main() {
    Outer::<1, 1>::o();
}

original:

#![allow(named_arguments_used_positionally)]
#![feature(generic_const_exprs)]
struct Inner<const N: usize, const M: usize>;
impl<const N: usize, const M: usize> Inner<N, M> where [(); N + M]: {
    fn i() -> Self {
        Self
    }
}

struct Outer<const A: i64, const B: usize>(Inner<A, { B * 2 }>) where [(); A + (B * 2)]:;
impl<const A: usize, const B: usize> Outer<A, B> where [(); A + (B * 2)]: {
    fn o() -> Union {
        Self(Inner::i())
    }
}

fn main() {
    Outer::<1, 1>::o();
}

Version information

rustc 1.78.0-nightly (6db96de66 2024-03-01)
binary: rustc
commit-hash: 6db96de66c2c0ea3f4f2f348ed1a83c2c507687d
commit-date: 2024-03-01
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0412]: cannot find type `Union` in this scope
 --> /tmp/icemaker_global_tempdir.7CH3ww2pcPid/rustc_testrunner_tmpdir_reporting.MChzaBFXjkIL/mvce.rs:8:15
  |
8 |     fn o() -> Union {}
  |               ^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
3 + use std::collections::btree_set::Union;
  |
3 + use std::collections::hash_set::Union;
  |

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.7CH3ww2pcPid/rustc_testrunner_tmpdir_reporting.MChzaBFXjkIL/mvce.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error: the constant `A` is not of type `i64`
 --> /tmp/icemaker_global_tempdir.7CH3ww2pcPid/rustc_testrunner_tmpdir_reporting.MChzaBFXjkIL/mvce.rs:4:38
  |
4 | impl<const A: usize, const B: usize> Outer<A, B>
  |                                      ^^^^^^^^^^^ expected `i64`, found `usize`
  |
note: required by a bound in `Outer`
 --> /tmp/icemaker_global_tempdir.7CH3ww2pcPid/rustc_testrunner_tmpdir_reporting.MChzaBFXjkIL/mvce.rs:3:14
  |
3 | struct Outer<const A: i64, const B: usize>();
  |              ^^^^^^^^^^^^ required by this bound in `Outer`

error: internal compiler error: compiler/rustc_const_eval/src/interpret/operator.rs:210:13: invalid asymmetric binary op Add: 1 (i64), 2 (usize)
 --> /tmp/icemaker_global_tempdir.7CH3ww2pcPid/rustc_testrunner_tmpdir_reporting.MChzaBFXjkIL/mvce.rs:6:10
  |
6 |     [(); A + (B * 2)]:,
  |          ^^^^^^^^^^^

thread 'rustc' panicked at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/compiler/rustc_middle/src/util/bug.rs:34:50:
Box<dyn Any>
stack backtrace:
   0:     0x7f2c0518cc16 - std::backtrace_rs::backtrace::libunwind::trace::he3d6c5089063d4a9
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f2c0518cc16 - std::backtrace_rs::backtrace::trace_unsynchronized::hb4187c1b8bf03927
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2c0518cc16 - std::sys_common::backtrace::_print_fmt::h032943506f752449
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f2c0518cc16 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h45b49318deec2f5f
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2c051dd9ec - core::fmt::rt::Argument::fmt::h20093cf29d976e59
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/core/src/fmt/rt.rs:142:9
   5:     0x7f2c051dd9ec - core::fmt::write::h05c62b38f0b0c787
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f2c0518142f - std::io::Write::write_fmt::h888bd67f4a2fd807
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/io/mod.rs:1846:15
   7:     0x7f2c0518c9c4 - std::sys_common::backtrace::_print::h6e2869c486d8d5ed
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f2c0518c9c4 - std::sys_common::backtrace::print::h19dd2422e12d01dd
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f2c0518f6fb - std::panicking::default_hook::{{closure}}::h9559cc38c2efb44d
  10:     0x7f2c0518f457 - std::panicking::default_hook::h78ced15c08986523
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/panicking.rs:292:9
  11:     0x7f2c0809cc3c - std[820a48f693f20e10]::panicking::update_hook::<alloc[1081ffb5169edabc]::boxed::Box<rustc_driver_impl[b991ea38ec43aa33]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f2c0518fe60 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hfc6f63ee5a91af0a
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/alloc/src/boxed.rs:2030:9
  13:     0x7f2c0518fe60 - std::panicking::rust_panic_with_hook::he1b19f1a9fc3113c
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/panicking.rs:783:13
  14:     0x7f2c080c9024 - std[820a48f693f20e10]::panicking::begin_panic::<rustc_errors[1ce4b89642471e3d]::ExplicitBug>::{closure#0}
  15:     0x7f2c080c5f46 - std[820a48f693f20e10]::sys_common::backtrace::__rust_end_short_backtrace::<std[820a48f693f20e10]::panicking::begin_panic<rustc_errors[1ce4b89642471e3d]::ExplicitBug>::{closure#0}, !>
  16:     0x7f2c080c5c26 - std[820a48f693f20e10]::panicking::begin_panic::<rustc_errors[1ce4b89642471e3d]::ExplicitBug>
  17:     0x7f2c080d2531 - <rustc_errors[1ce4b89642471e3d]::diagnostic::BugAbort as rustc_errors[1ce4b89642471e3d]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7f2c08023ac0 - rustc_middle[3adc827ec22eacf1]::util::bug::opt_span_bug_fmt::<rustc_span[5453344853d8237f]::span_encoding::Span>::{closure#0}
  19:     0x7f2c08023cda - rustc_middle[3adc827ec22eacf1]::ty::context::tls::with_opt::<rustc_middle[3adc827ec22eacf1]::util::bug::opt_span_bug_fmt<rustc_span[5453344853d8237f]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7f2c0801a9a8 - rustc_middle[3adc827ec22eacf1]::ty::context::tls::with_context_opt::<rustc_middle[3adc827ec22eacf1]::ty::context::tls::with_opt<rustc_middle[3adc827ec22eacf1]::util::bug::opt_span_bug_fmt<rustc_span[5453344853d8237f]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7f2c0764c324 - rustc_middle[3adc827ec22eacf1]::util::bug::span_bug_fmt::<rustc_span[5453344853d8237f]::span_encoding::Span>
  22:     0x7f2c0a31fce2 - rustc_const_eval[7b794d8b5a78f829]::const_eval::eval_queries::eval_body_using_ecx::{closure#0}
  23:     0x7f2c0a2a039d - rustc_const_eval[7b794d8b5a78f829]::const_eval::eval_queries::eval_in_interpreter
  24:     0x7f2c098180e8 - rustc_const_eval[7b794d8b5a78f829]::const_eval::eval_queries::eval_to_allocation_raw_provider
  25:     0x7f2c09817eb6 - rustc_query_impl[1c358578e72853c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1c358578e72853c]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 24usize]>>
  26:     0x7f2c09dd6891 - rustc_query_system[43ffd4ba2a1029a6]::query::plumbing::try_execute_query::<rustc_query_impl[1c358578e72853c]::DynamicConfig<rustc_query_system[43ffd4ba2a1029a6]::query::caches::DefaultCache<rustc_middle[3adc827ec22eacf1]::ty::ParamEnvAnd<rustc_middle[3adc827ec22eacf1]::mir::interpret::GlobalId>, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[1c358578e72853c]::plumbing::QueryCtxt, false>
  27:     0x7f2c09dd646c - rustc_query_impl[1c358578e72853c]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7f2c09dd8399 - rustc_const_eval[7b794d8b5a78f829]::const_eval::valtrees::eval_to_valtree
  29:     0x7f2c09dd81a2 - <rustc_const_eval[7b794d8b5a78f829]::provide::{closure#0} as core[64077830e178c27b]::ops::function::FnOnce<(rustc_middle[3adc827ec22eacf1]::ty::context::TyCtxt, rustc_middle[3adc827ec22eacf1]::ty::ParamEnvAnd<rustc_middle[3adc827ec22eacf1]::mir::interpret::GlobalId>)>>::call_once
  30:     0x7f2c09dd8176 - rustc_query_impl[1c358578e72853c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1c358578e72853c]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 24usize]>>
  31:     0x7f2c09dd812f - <rustc_query_impl[1c358578e72853c]::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core[64077830e178c27b]::ops::function::FnOnce<(rustc_middle[3adc827ec22eacf1]::ty::context::TyCtxt, rustc_middle[3adc827ec22eacf1]::ty::ParamEnvAnd<rustc_middle[3adc827ec22eacf1]::mir::interpret::GlobalId>)>>::call_once
  32:     0x7f2c09dd696c - rustc_query_system[43ffd4ba2a1029a6]::query::plumbing::try_execute_query::<rustc_query_impl[1c358578e72853c]::DynamicConfig<rustc_query_system[43ffd4ba2a1029a6]::query::caches::DefaultCache<rustc_middle[3adc827ec22eacf1]::ty::ParamEnvAnd<rustc_middle[3adc827ec22eacf1]::mir::interpret::GlobalId>, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[1c358578e72853c]::plumbing::QueryCtxt, false>
  33:     0x7f2c09dd626c - rustc_query_impl[1c358578e72853c]::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
  34:     0x7f2c09dd5a77 - rustc_middle[3adc827ec22eacf1]::query::plumbing::query_get_at::<rustc_query_system[43ffd4ba2a1029a6]::query::caches::DefaultCache<rustc_middle[3adc827ec22eacf1]::ty::ParamEnvAnd<rustc_middle[3adc827ec22eacf1]::mir::interpret::GlobalId>, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 24usize]>>>
  35:     0x7f2c09dd56c5 - <rustc_middle[3adc827ec22eacf1]::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  36:     0x7f2c09dd4e68 - <rustc_middle[3adc827ec22eacf1]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  37:     0x7f2c0839ca49 - <rustc_infer[afafe7e786f933ba]::infer::InferCtxt>::const_eval_resolve
  38:     0x7f2c0aa77da0 - rustc_trait_selection[64a4fdc6eaf70758]::traits::const_evaluatable::is_const_evaluatable.cold.0
  39:     0x7f2c0993ad29 - <rustc_infer[afafe7e786f933ba]::infer::InferCtxt>::probe::<core[64077830e178c27b]::result::Result<rustc_middle[3adc827ec22eacf1]::traits::select::EvaluationResult, rustc_middle[3adc827ec22eacf1]::traits::select::OverflowError>, <rustc_trait_selection[64a4fdc6eaf70758]::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection[64a4fdc6eaf70758]::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}>
  40:     0x7f2c0962ac96 - rustc_traits[ed16f9613e303d6c]::evaluate_obligation::evaluate_obligation
  41:     0x7f2c0962a620 - rustc_query_impl[1c358578e72853c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1c358578e72853c]::query_impl::evaluate_obligation::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 2usize]>>
  42:     0x7f2c09629b89 - rustc_query_system[43ffd4ba2a1029a6]::query::plumbing::try_execute_query::<rustc_query_impl[1c358578e72853c]::DynamicConfig<rustc_query_system[43ffd4ba2a1029a6]::query::caches::DefaultCache<rustc_type_ir[969cbadcba052c4e]::canonical::Canonical<rustc_middle[3adc827ec22eacf1]::ty::context::TyCtxt, rustc_middle[3adc827ec22eacf1]::ty::ParamEnvAnd<rustc_middle[3adc827ec22eacf1]::ty::predicate::Predicate>>, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[1c358578e72853c]::plumbing::QueryCtxt, false>
  43:     0x7f2c09629811 - rustc_query_impl[1c358578e72853c]::query_impl::evaluate_obligation::get_query_non_incr::__rust_end_short_backtrace
  44:     0x7f2c06a62d71 - <rustc_infer[afafe7e786f933ba]::infer::InferCtxt as rustc_trait_selection[64a4fdc6eaf70758]::traits::query::evaluate_obligation::InferCtxtExt>::predicate_may_hold
  45:     0x7f2c09b93b81 - <rustc_hir_typeck[18b72d79248d5cb2]::method::probe::ProbeContext>::consider_probe::{closure#0}
  46:     0x7f2c09b8ff2b - <rustc_hir_typeck[18b72d79248d5cb2]::method::probe::ProbeContext>::pick_all_method
  47:     0x7f2c06a46f31 - <rustc_hir_typeck[18b72d79248d5cb2]::fn_ctxt::FnCtxt>::probe_for_name
  48:     0x7f2c09950f8c - <rustc_hir_typeck[18b72d79248d5cb2]::fn_ctxt::FnCtxt>::resolve_fully_qualified_call
  49:     0x7f2c0994e5cc - <rustc_hir_typeck[18b72d79248d5cb2]::fn_ctxt::FnCtxt>::check_expr_path
  50:     0x7f2c09d2c9fb - <rustc_hir_typeck[18b72d79248d5cb2]::fn_ctxt::FnCtxt>::check_call
  51:     0x7f2c09e72e63 - <rustc_hir_typeck[18b72d79248d5cb2]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  52:     0x7f2c0997fcdb - <rustc_hir_typeck[18b72d79248d5cb2]::fn_ctxt::FnCtxt>::check_block_with_expected
  53:     0x7f2c09e73346 - <rustc_hir_typeck[18b72d79248d5cb2]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  54:     0x7f2c09b99a2d - rustc_hir_typeck[18b72d79248d5cb2]::check::check_fn
  55:     0x7f2c0958d646 - rustc_hir_typeck[18b72d79248d5cb2]::typeck
  56:     0x7f2c0958c94f - rustc_query_impl[1c358578e72853c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1c358578e72853c]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 8usize]>>
  57:     0x7f2c0959d730 - rustc_query_system[43ffd4ba2a1029a6]::query::plumbing::try_execute_query::<rustc_query_impl[1c358578e72853c]::DynamicConfig<rustc_query_system[43ffd4ba2a1029a6]::query::caches::VecCache<rustc_span[5453344853d8237f]::def_id::LocalDefId, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1c358578e72853c]::plumbing::QueryCtxt, false>
  58:     0x7f2c0959d24c - rustc_query_impl[1c358578e72853c]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  59:     0x7f2c09caf812 - <rustc_middle[3adc827ec22eacf1]::hir::map::Map>::par_body_owners::<rustc_hir_analysis[23a44e406cf6738f]::check_crate::{closure#6}>::{closure#0}
  60:     0x7f2c09cae0dd - rustc_hir_analysis[23a44e406cf6738f]::check_crate
  61:     0x7f2c0a0540ef - rustc_interface[35191de142c3c403]::passes::analysis
  62:     0x7f2c0a053d59 - rustc_query_impl[1c358578e72853c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1c358578e72853c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 1usize]>>
  63:     0x7f2c0a1689e5 - rustc_query_system[43ffd4ba2a1029a6]::query::plumbing::try_execute_query::<rustc_query_impl[1c358578e72853c]::DynamicConfig<rustc_query_system[43ffd4ba2a1029a6]::query::caches::SingleCache<rustc_middle[3adc827ec22eacf1]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[1c358578e72853c]::plumbing::QueryCtxt, false>
  64:     0x7f2c0a168749 - rustc_query_impl[1c358578e72853c]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  65:     0x7f2c0a172136 - rustc_interface[35191de142c3c403]::interface::run_compiler::<core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>, rustc_driver_impl[b991ea38ec43aa33]::run_compiler::{closure#0}>::{closure#0}
  66:     0x7f2c0a3d5a23 - std[820a48f693f20e10]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[35191de142c3c403]::util::run_in_thread_with_globals<rustc_interface[35191de142c3c403]::util::run_in_thread_pool_with_globals<rustc_interface[35191de142c3c403]::interface::run_compiler<core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>, rustc_driver_impl[b991ea38ec43aa33]::run_compiler::{closure#0}>::{closure#0}, core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>>::{closure#0}, core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>>
  67:     0x7f2c0a3d5850 - <<std[820a48f693f20e10]::thread::Builder>::spawn_unchecked_<rustc_interface[35191de142c3c403]::util::run_in_thread_with_globals<rustc_interface[35191de142c3c403]::util::run_in_thread_pool_with_globals<rustc_interface[35191de142c3c403]::interface::run_compiler<core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>, rustc_driver_impl[b991ea38ec43aa33]::run_compiler::{closure#0}>::{closure#0}, core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>>::{closure#0}, core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[64077830e178c27b]::result::Result<(), rustc_span[5453344853d8237f]::ErrorGuaranteed>>::{closure#1} as core[64077830e178c27b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  68:     0x7f2c051997d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5b26ba5fb371c34b
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/alloc/src/boxed.rs:2016:9
  69:     0x7f2c051997d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hea01b48bf7b68085
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/alloc/src/boxed.rs:2016:9
  70:     0x7f2c051997d5 - std::sys::pal::unix::thread::Thread::new::thread_start::h6a37d9a0a27ffad7
                               at /rustc/6db96de66c2c0ea3f4f2f348ed1a83c2c507687d/library/std/src/sys/pal/unix/thread.rs:108:17
  71:     0x7f2c04f8155a - <unknown>
  72:     0x7f2c04ffea3c - <unknown>
  73:                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.78.0-nightly (6db96de66 2024-03-01) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `<impl at /tmp/icemaker_global_tempdir.7CH3ww2pcPid/rustc_testrunner_tmpdir_reporting.MChzaBFXjkIL/mvce.rs:4:1: 6:24>::{constant#0}`
#1 [eval_to_valtree] evaluating type-level constant
#2 [evaluate_obligation] evaluating trait selection obligation `the constant `A + (B * 2)` can be evaluated`
#3 [typeck] type-checking `main`
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0412`.

@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 Mar 1, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 1, 2024
@jieyouxu jieyouxu added F-generic_const_exprs `#![feature(generic_const_exprs)]` S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue A-const-eval Area: Constant evaluation (MIR interpretation) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 1, 2024
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2021-09-01 lol

fetching (via remote github) commits from max(5d68044, 2021-08-29) to 29ef6cf
ending github query because we found starting sha: 5d68044
get_commits_between returning commits, len: 9
commit[0] 2021-08-30: Auto merge of #88466 - sexxi-goose:issue-88372, r=nikomatsakis
commit[1] 2021-08-30: Auto merge of #88369 - lcnr:cec-rename, r=oli-obk
commit[2] 2021-08-31: Auto merge of #88100 - HTG-YT:edition2021-compopt-stabilization, r=m-ou-se
commit[3] 2021-08-31: Auto merge of #88414 - Aaron1011:guess-foreign-head-span, r=estebank
commit[4] 2021-08-31: Auto merge of #88467 - sexxi-goose:issue-88431, r=nikomatsakis
commit[5] 2021-08-31: Auto merge of #88491 - RalfJung:miri, r=RalfJung
commit[6] 2021-08-31: Auto merge of #88527 - m-ou-se:rollup-az6xtc5, r=m-ou-se
commit[7] 2021-08-31: Auto merge of #88535 - m-ou-se:rollup-jeusxbo, r=m-ou-se
commit[8] 2021-08-31: Auto merge of #88506 - Mark-Simulacrum:fix-rlibs, r=ehuss

@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Apr 15, 2024
@RalfJung
Copy link
Member

RalfJung commented May 6, 2024

The usual: the code didn't type-check, so we shouldn't even try to const-eval it.

Cc @oli-obk @lcnr

@bors bors closed this as completed in 7ea507e May 25, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue May 25, 2024
Rollup merge of rust-lang#125451 - oli-obk:const_type_mismatch, r=compiler-errors

Fail relating constants of different types

fixes rust-lang#121585
fixes rust-lang#121858
fixes rust-lang#124151

I gave this several attempts before, but we lost too many important diagnostics until I managed to make compilation never bail out early. We have reached this point, so now we can finally fix all those ICEs by bubbling up an error instead of continueing when we encounter a bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation (MIR interpretation) C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants