Closed as duplicate of#135870
Description
It is an invalid data structure (because it is recursive), and the complier can't know size on compile time.
But compiler panic is unexpected here.
Code
use brg_core::prelude::{Chunk, V2};
#[derive(Default, Copy, Clone)]
pub struct LodQuadTree {
pos: V2,
size: V2,
len: u32,
child: Option<[LodQuadTree; 4]>, // problem on this line (recursive)
}
Meta
rustc --version --verbose
:
rustc 1.86.0-nightly (f85c6de55 2025-01-26)
binary: rustc
commit-hash: f85c6de55206dbee5ffedfd821df1503a7b92346
commit-date: 2025-01-26
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
LLVM version: 19.1.7
Error output
thread 'rustc query cycle handler' panicked at compiler/rustc_query_system/src/query/job.rs:502:9:
deadlock detected as we're unable to find a query cycle to break
current query map:
{}
stack backtrace:
0: 0x7adb02bb1625 - std::backtrace::Backtrace::create::h016cd0347bc39098
1: 0x7adb00f8e6f5 - std::backtrace::Backtrace::force_capture::h90cd71109775fcb3
2: 0x7adb0015b864 - std[cc940dec3ff43b12]::panicking::update_hook::<alloc[5f7a888829935c2b]::boxed::Box<rustc_driver_impl[af2bdb3744899392]::install_ice_hook::{closure#1}>>::{closure#0}
3: 0x7adb00fa7073 - std::panicking::rust_panic_with_hook::hbfeeff1ab3569ba1
4: 0x7adb00fa6d6a - std::panicking::begin_panic_handler::{{closure}}::h32c93c4f5d28ab99
5: 0x7adb00fa46e9 - std::sys::backtrace::__rust_end_short_backtrace::h1884c239824d44f7
6: 0x7adb00fa6a2d - rust_begin_unwind
7: 0x7adafdc39bd0 - core::panicking::panic_fmt::he58927c3c03479ba
8: 0x7adb00b9dcba - rustc_query_system[b5c6449b7ccd2566]::query::job::break_query_cycles
9: 0x7adb001517dc - std[cc940dec3ff43b12]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[d0d5d02e7a56d74f]::util::run_in_thread_pool_with_globals<rustc_interface[d0d5d02e7a56d74f]::interface::run_compiler<(), rustc_driver_impl[af2bdb3744899392]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#2}::{closure#1}, ()>
10: 0x7adb00162e98 - <<std[cc940dec3ff43b12]::thread::Builder>::spawn_unchecked_<rustc_interface[d0d5d02e7a56d74f]::util::run_in_thread_pool_with_globals<rustc_interface[d0d5d02e7a56d74f]::interface::run_compiler<(), rustc_driver_impl[af2bdb3744899392]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#2}::{closure#1}, ()>::{closure#1} as core[c1de5c9ad145c0db]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
11: 0x7adb0266832b - std::sys::pal::unix::thread::Thread::new::thread_start::hb22e947f5885a296
12: 0x7adafc69ca94 - start_thread
at ./nptl/pthread_create.c:447:8
13: 0x7adafc729c3c - clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
14: 0x0 - <unknown>
rustc version: 1.86.0-nightly (f85c6de55 2025-01-26)
platform: x86_64-unknown-linux-gnu