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

unable to construct a constant value for the unevaluated constant UnevaluatedConst { def: DefId(0:73 ~ test_3[ea46]::v20::{impl#3}::{constant#1}), args: [?0c: usize] } #119731

Closed
Doremisolatido opened this issue Jan 8, 2024 · 1 comment · Fixed by #122988
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. F-generic_const_exprs `#![feature(generic_const_exprs)]` 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

@Doremisolatido
Copy link

Code

#![feature(generic_const_exprs)]

mod v20 {
const v4: usize = 512;
pub type v11 = [[usize; v4]; v4];
const v2: v11 = [[256; v4]; v4];

const v0: [[usize; v4]; v4] = v6(v8);
pub struct v17<const v10: usize, const v7: v11> {
_p: (),
}

impl v17<512, v0> {
pub const fn v21() -> v18 {
}
}

impl<const v10: usize> v17<v10, v2> {
pub const fn v21() -> v18 {
v18 { _p: () }
}
}
}
pub use v20::{v13, v17};
fn main() {
}

Meta

rustc --version --verbose:

rustc 1.77.0-nightly (d8b44d280 2024-01-07)
binary: rustc
commit-hash: d8b44d2802ab665b183dce06d527bf09175dd8cf
commit-date: 2024-01-07
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Error output

error: internal compiler error: compiler/rustc_infer/src/infer/mod.rs:1583:17: unable to construct a constant value for the unevaluated constant UnevaluatedConst { def: DefId(0:73 ~ test_3[ea46]::v20::{impl#3}::{constant#1}), args: [?0c: usize] }
Backtrace

stack backtrace:
   0:     0x7fd8ea92d477 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9b88b6f3ca46a608
   1:     0x7fd8ea98b470 - core::fmt::write::h006931418f3178a6
   2:     0x7fd8ea919f1f - std::io::Write::write_fmt::hef1b13539c871113
   3:     0x7fd8ea92d244 - std::sys_common::backtrace::print::hdf04dd1e52b85090
   4:     0x7fd8ea92e14a - std::panicking::default_hook::{{closure}}::h38e3ca5d3417a132
   5:     0x7fd8ea92de73 - std::panicking::default_hook::h7c8bd090cc5c8cb1
   6:     0x7fd8eb4a0c37 - <alloc[ab03fe8b414083ab]::boxed::Box<rustc_driver_impl[2320baa211b147c5]::install_ice_hook::{closure#0}> as core[da5ff848ab5b9634]::ops::function::Fn<(&dyn for<'a, 'b> core[da5ff848ab5b9634]::ops::function::Fn<(&'a core[da5ff848ab5b9634]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[da5ff848ab5b9634]::marker::Sync + core[da5ff848ab5b9634]::marker::Send, &core[da5ff848ab5b9634]::panic::panic_info::PanicInfo)>>::call
   7:     0x7fd8ea92e898 - std::panicking::rust_panic_with_hook::h39552955130d1e24
   8:     0x7fd8f06e8786 - std[9295f5ecf1531c2a]::panicking::begin_panic::<rustc_errors[aa2fa569483a35a2]::ExplicitBug>::{closure#0}
   9:     0x7fd8f06e3576 - std[9295f5ecf1531c2a]::sys_common::backtrace::__rust_end_short_backtrace::<std[9295f5ecf1531c2a]::panicking::begin_panic<rustc_errors[aa2fa569483a35a2]::ExplicitBug>::{closure#0}, !>
  10:     0x7fd8eb410fd6 - std[9295f5ecf1531c2a]::panicking::begin_panic::<rustc_errors[aa2fa569483a35a2]::ExplicitBug>
  11:     0x7fd8f06daf21 - <rustc_errors[aa2fa569483a35a2]::diagnostic_builder::BugAbort as rustc_errors[aa2fa569483a35a2]::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7fd8efaab223 - <rustc_errors[aa2fa569483a35a2]::DiagCtxt>::span_bug::<rustc_span[7e71af783b1896b5]::span_encoding::Span, alloc[ab03fe8b414083ab]::string::String>
  13:     0x7fd8efadea64 - rustc_middle[712429aa67461ada]::util::bug::opt_span_bug_fmt::<rustc_span[7e71af783b1896b5]::span_encoding::Span>::{closure#0}
  14:     0x7fd8efadeaba - rustc_middle[712429aa67461ada]::ty::context::tls::with_opt::<rustc_middle[712429aa67461ada]::util::bug::opt_span_bug_fmt<rustc_span[7e71af783b1896b5]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x7fd8efad0c18 - rustc_middle[712429aa67461ada]::ty::context::tls::with_context_opt::<rustc_middle[712429aa67461ada]::ty::context::tls::with_opt<rustc_middle[712429aa67461ada]::util::bug::opt_span_bug_fmt<rustc_span[7e71af783b1896b5]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x7fd8eb365857 - rustc_middle[712429aa67461ada]::util::bug::span_bug_fmt::<rustc_span[7e71af783b1896b5]::span_encoding::Span>
  17:     0x7fd8efac2831 - <rustc_infer[908d548d92158755]::infer::InferCtxt>::try_const_eval_resolve
  18:     0x7fd8ef843425 - <rustc_trait_selection[ec9264a6e6df17]::traits::select::SelectionContext>::evaluate_predicate_recursively::{closure#0}::{closure#0}
  19:     0x7fd8ef84231d - <rustc_trait_selection[ec9264a6e6df17]::traits::select::SelectionContext>::evaluate_predicate_recursively
  20:     0x7fd8ef9a7afc - <rustc_infer[908d548d92158755]::infer::InferCtxt>::probe::<core[da5ff848ab5b9634]::result::Result<rustc_middle[712429aa67461ada]::traits::select::EvaluationResult, rustc_middle[712429aa67461ada]::traits::select::OverflowError>, <rustc_trait_selection[ec9264a6e6df17]::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection[ec9264a6e6df17]::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}>
  21:     0x7fd8ef95bee3 - rustc_trait_selection[ec9264a6e6df17]::traits::coherence::overlap
  22:     0x7fd8ef95b8da - rustc_trait_selection[ec9264a6e6df17]::traits::coherence::overlapping_impls
  23:     0x7fd8ee5c9648 - <rustc_hir_analysis[70120cffb8a4fd07]::coherence::inherent_impls_overlap::InherentOverlapChecker>::check_for_overlapping_inherent_impls
  24:     0x7fd8ee5c58ff - rustc_hir_analysis[70120cffb8a4fd07]::coherence::inherent_impls_overlap::crate_inherent_impls_overlap_check
  25:     0x7fd8ef3a2c8a - rustc_query_impl[c09cc8fff495313c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c09cc8fff495313c]::query_impl::crate_inherent_impls_overlap_check::dynamic_query::{closure#2}::{closure#0}, rustc_middle[712429aa67461ada]::query::erase::Erased<[u8; 0usize]>>
  26:     0x7fd8ef41b518 - <rustc_query_impl[c09cc8fff495313c]::query_impl::crate_inherent_impls_overlap_check::dynamic_query::{closure#2} as core[da5ff848ab5b9634]::ops::function::FnOnce<(rustc_middle[712429aa67461ada]::ty::context::TyCtxt, ())>>::call_once
  27:     0x7fd8ef60c83b - rustc_query_system[3a5b469aacd7ee53]::query::plumbing::try_execute_query::<rustc_query_impl[c09cc8fff495313c]::DynamicConfig<rustc_query_system[3a5b469aacd7ee53]::query::caches::SingleCache<rustc_middle[712429aa67461ada]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[c09cc8fff495313c]::plumbing::QueryCtxt, false>
  28:     0x7fd8ef448b63 - rustc_query_impl[c09cc8fff495313c]::query_impl::crate_inherent_impls_overlap_check::get_query_non_incr::__rust_end_short_backtrace
  29:     0x7fd8ee668551 - <rustc_session[9285c94e3a71432f]::session::Session>::track_errors::<rustc_hir_analysis[70120cffb8a4fd07]::check_crate::{closure#2}, ()>
  30:     0x7fd8ee5ce2b3 - rustc_hir_analysis[70120cffb8a4fd07]::check_crate
  31:     0x7fd8eb66ccc0 - rustc_interface[b5ea119f6d9fba02]::passes::analysis
  32:     0x7fd8ef3a318a - rustc_query_impl[c09cc8fff495313c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c09cc8fff495313c]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[712429aa67461ada]::query::erase::Erased<[u8; 1usize]>>
  33:     0x7fd8ef554708 - <rustc_query_impl[c09cc8fff495313c]::query_impl::analysis::dynamic_query::{closure#2} as core[da5ff848ab5b9634]::ops::function::FnOnce<(rustc_middle[712429aa67461ada]::ty::context::TyCtxt, ())>>::call_once
  34:     0x7fd8ef611fac - rustc_query_system[3a5b469aacd7ee53]::query::plumbing::try_execute_query::<rustc_query_impl[c09cc8fff495313c]::DynamicConfig<rustc_query_system[3a5b469aacd7ee53]::query::caches::SingleCache<rustc_middle[712429aa67461ada]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[c09cc8fff495313c]::plumbing::QueryCtxt, false>
  35:     0x7fd8ef437043 - rustc_query_impl[c09cc8fff495313c]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7fd8eb47f04b - <rustc_middle[712429aa67461ada]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[2320baa211b147c5]::run_compiler::{closure#0}::{closure#0}::{closure#3}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>
  37:     0x7fd8eb506869 - <rustc_interface[b5ea119f6d9fba02]::interface::Compiler>::enter::<rustc_driver_impl[2320baa211b147c5]::run_compiler::{closure#0}::{closure#0}, core[da5ff848ab5b9634]::result::Result<core[da5ff848ab5b9634]::option::Option<rustc_interface[b5ea119f6d9fba02]::queries::Linker>, rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>
  38:     0x7fd8eb4c8469 - rustc_span[7e71af783b1896b5]::set_source_map::<core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>, rustc_interface[b5ea119f6d9fba02]::interface::run_compiler<core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>, rustc_driver_impl[2320baa211b147c5]::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
  39:     0x7fd8eb4ae7d3 - <scoped_tls[8787e17a3822f26a]::ScopedKey<rustc_span[7e71af783b1896b5]::SessionGlobals>>::set::<rustc_interface[b5ea119f6d9fba02]::util::run_in_thread_pool_with_globals<rustc_interface[b5ea119f6d9fba02]::interface::run_compiler<core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>, rustc_driver_impl[2320baa211b147c5]::run_compiler::{closure#0}>::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>
  40:     0x7fd8eb4c8959 - rustc_span[7e71af783b1896b5]::create_session_globals_then::<core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>, rustc_interface[b5ea119f6d9fba02]::util::run_in_thread_pool_with_globals<rustc_interface[b5ea119f6d9fba02]::interface::run_compiler<core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>, rustc_driver_impl[2320baa211b147c5]::run_compiler::{closure#0}>::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>::{closure#0}>
  41:     0x7fd8eb4b7cae - std[9295f5ecf1531c2a]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b5ea119f6d9fba02]::util::run_in_thread_with_globals<rustc_interface[b5ea119f6d9fba02]::util::run_in_thread_pool_with_globals<rustc_interface[b5ea119f6d9fba02]::interface::run_compiler<core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>, rustc_driver_impl[2320baa211b147c5]::run_compiler::{closure#0}>::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>
  42:     0x7fd8eb4b8ad1 - <<std[9295f5ecf1531c2a]::thread::Builder>::spawn_unchecked_<rustc_interface[b5ea119f6d9fba02]::util::run_in_thread_with_globals<rustc_interface[b5ea119f6d9fba02]::util::run_in_thread_pool_with_globals<rustc_interface[b5ea119f6d9fba02]::interface::run_compiler<core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>, rustc_driver_impl[2320baa211b147c5]::run_compiler::{closure#0}>::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[da5ff848ab5b9634]::result::Result<(), rustc_span[7e71af783b1896b5]::ErrorGuaranteed>>::{closure#1} as core[da5ff848ab5b9634]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  43:     0x7fd8ea95c685 - std::sys::unix::thread::Thread::new::thread_start::h0316d03ce42d35a5
  44:     0x7fd8ea694ac3 - start_thread
                               at ./nptl/pthread_create.c:442:8
  45:     0x7fd8ea726660 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  46:                0x0 - <unknown>

@Doremisolatido Doremisolatido 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. labels Jan 8, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 8, 2024
@fmease fmease added the F-generic_const_exprs `#![feature(generic_const_exprs)]` label Jan 8, 2024
@sjwang05
Copy link
Contributor

sjwang05 commented Jan 8, 2024

Fixed by #119060--possibly a duplicate of #118545?

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 14, 2024
@matthiaskrgr matthiaskrgr added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Feb 11, 2024
@bors bors closed this as completed in 127c36c Mar 25, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 25, 2024
Rollup merge of rust-lang#122988 - matthiaskrgr:icetests, r=petrochenkov

add even more tests!

Fixes rust-lang#109869
Fixes rust-lang#110453
Fixes rust-lang#109020
Fixes rust-lang#108580
Fixes rust-lang#108220
Fixes rust-lang#113045
Fixes rust-lang#113133
Fixes rust-lang#114464
Fixes rust-lang#116599
Fixes rust-lang#119731
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. F-generic_const_exprs `#![feature(generic_const_exprs)]` 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.

6 participants