Closed
Description
Code
fn mutate_vec_at(map : &mut Vec<Vec<u8>>, row_id : usize, cell_id : usize, store : &mut Vec<(usize, usize)>){
let mut val = map[row_id][cell_id];
if val != 0 {
val += 1;
if val > 9{
store.push((row_id, cell_id));
val = 0;
}
map[row_id][cell_id] = val;
}
}
Meta
rustc --version --verbose
:
<version>
rustc 1.58.0-nightly (65f3f8b22 2021-11-21)
binary: rustc
commit-hash: 65f3f8b220f020e562c5dd848ff7319257a7ba45
commit-date: 2021-11-21
host: x86_64-unknown-linux-gnu
release: 1.58.0-nightly
LLVM version: 13.0.0
Error output
thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:445:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
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.58.0-nightly (65f3f8b22 2021-11-21) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [unsafety_check_result] unsafety-checking `MATRIX_SIZE`
#1 [analysis] running analysis passes on this crate end of query stack
BackTrace
No backtrace, the bug desappeared after a clean and rebuild