thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/validity.rs:727:21:
assertion `left == right` failed
left: Mut
right: Not
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed::<rustc_ast_ir::Mutability, rustc_ast_ir::Mutability>
4: rustc_const_eval::interpret::validity::mutability::<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>
5: <rustc_const_eval::interpret::validity::ValidityVisitor<rustc_const_eval::const_eval::machine::CompileTimeInterpreter> as rustc_const_eval::interpret::visitor::ValueVisitor<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::visit_value
6: <rustc_const_eval::interpret::validity::ValidityVisitor<rustc_const_eval::const_eval::machine::CompileTimeInterpreter> as rustc_const_eval::interpret::visitor::ValueVisitor<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::walk_value
7: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::validate_operand_internal
8: rustc_const_eval::const_eval::eval_queries::eval_static_initializer_provider
[... omitted 2 frames ...]
9: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#3}>::{closure#0}
10: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_analysis::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>
11: rustc_hir_analysis::check_crate
12: rustc_interface::passes::analysis
[... omitted 2 frames ...]
13: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#3}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
14: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: please make sure that you have updated to the latest nightly
note: please attach the file at `/Users/jisukbyun/workspace/placeholder/240420_rustexec/rustc-ice-2024-04-19T15_57_00-86400.txt` to your bug report
query stack during panic:
#0 [eval_static_initializer] evaluating initializer of static `S_COUNT`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error
Code
(minimized)
EDIT:
static S_COUNT = std::sync::atomic::AtomicUsize::new(0);also causes ICE.Original Code
Meta
rustc --version --verbose:Command
rustcError output
Backtrace
Note
ICE-loc:
compiler/rustc_const_eval/src/interpret/validity.rs:727:21rust/compiler/rustc_const_eval/src/interpret/validity.rs
Lines 726 to 728 in e3181b0
Original ICE-triggering code is mutated from test-file
dropck_trait_cycle_checked.rsrust/tests/ui/dropck/dropck_trait_cycle_checked.rs
Line 12 in 07d0d7c