Skip to content

Crash when compiling an event handler implementation with latest stable rustc 1.88.0 #143821

Open
@gents83

Description

@gents83

Code

you can find it here:
https://github.com/gents83/INOX/blob/master/crates/resources/src/event_handlers.rs
compiling the crate inside:
https://github.com/gents83/INOX/tree/master/crates/resources

impl<T> EventHandler for SerializableResourceEventHandler<T>
where
    T: SerializableResource,
    <T as DataTypeResource>::DataType: Send + Sync,
{
    fn handle_events(&self, f: &dyn LoadFunction) {
        self.listener
            .process_messages(|msg: &SerializableResourceEvent<T>| {
                let SerializableResourceEvent::<T>::Load(path, on_create_data) = msg;
                //inox_log::debug_log!("Received load event for: {:?}", path);
                if <T as SerializableResource>::is_matching_extension(path.as_path()) {
                    //inox_log::debug_log!("Handling it!");
                    let p = path.clone();
                    let on_create_data = on_create_data.clone();
                    f(Box::new(move |shared_data, message_hub| {
                        T::create_from_file(shared_data, message_hub, p.as_path(), on_create_data);
                    }));
                }
            });
    }
}

Meta

rustc version 1.88.0

Error output

error: internal compiler error: compiler\rustc_borrowck\src\universal_regions.rs:928:36: cannot convert `ReLateParam(DefId(0:225 ~ inox_resources[5473]::event_handlers::{impl#6}::handle_events::{closure#0}), LateNamed(DefId(0:722 ~ inox_resources[5473]::event_handlers::{impl#6}::handle_events::'_), '_))` to a region vid


thread 'rustc' panicked at compiler\rustc_borrowck\src\universal_regions.rs:928:36:
Box<dyn Any>
stack backtrace:
   0:     0x7ff85e7ba9c2 - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ff85e7ba9c2 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff85e7ba9c2 - std::sys::backtrace::_print_fmt
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\backtrace.rs:66
   3:     0x7ff85e7ba9c2 - std::sys::backtrace::impl$0::print::impl$0::fmt
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\backtrace.rs:39
   4:     0x7ff85e7ed18b - core::fmt::rt::Argument::fmt
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\fmt\rt.rs:181
   5:     0x7ff85e7ed18b - core::fmt::write
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\core\src\fmt\mod.rs:1446
   6:     0x7ff85e7b0b17 - std::io::default_write_fmt
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\io\mod.rs:639
   7:     0x7ff85e7b0b17 - std::io::Write::write_fmt<std::sys::stdio::windows::Stderr>
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\io\mod.rs:1914
   8:     0x7ff85e7ba805 - std::sys::backtrace::BacktraceLock::print
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\backtrace.rs:42
   9:     0x7ff85e7c045a - std::panicking::default_hook::closure$0
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:300
  10:     0x7ff85e7c01f0 - std::panicking::default_hook
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:327
  11:     0x7ff85fedf589 - core[3c86ab912ec38c67]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[852ad02eb4e36d75]::Level, &str), usize), <((rustc_lint_defs[852ad02eb4e36d75]::Level, &str), usize) as core[3c86ab912ec38c67]::cmp::PartialOrd>::lt>
  12:     0x7ff85e7c10ee - std::panicking::rust_panic_with_hook
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\panicking.rs:841
  13:     0x7ff861776943 - RINvNtNtNtNtCs5cb5cxfFw7H_4core5slice4sort6stable9quicksort9quicksortTjRNtNtCs2UPeNLgV7Nx_12rustc_errors7snippet10AnnotationENCINvMNtCs2ocB3yIIgEv_5alloc5sliceSB15_11sort_by_keyTINtNtBa_3cmp7ReversejEbENCNCNvMs5_NtB1c_7emitterNtB3o_12HumanEmitter18render_s
  14:     0x7ff861769e89 - std[df32d1bc89881d89]::sys::backtrace::__rust_end_short_backtrace::<std[df32d1bc89881d89]::panicking::begin_panic<rustc_errors[21f88e7a2b20a5b5]::ExplicitBug>::{closure#0}, !>
  15:     0x7ff861769e71 - std[df32d1bc89881d89]::panicking::begin_panic::<rustc_errors[21f88e7a2b20a5b5]::ExplicitBug>
  16:     0x7ff861783bc5 - <rustc_errors[21f88e7a2b20a5b5]::diagnostic::BugAbort as rustc_errors[21f88e7a2b20a5b5]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  17:     0x7ff8616c8c29 - rustc_middle[415f7117aa72a916]::util::bug::span_bug_fmt::<rustc_span[42e336d87a219f10]::span_encoding::Span>
  18:     0x7ff861699cdd - <rustc_middle[415f7117aa72a916]::ty::consts::Const>::walk
  19:     0x7ff861699aa6 - <rustc_middle[415f7117aa72a916]::ty::consts::Const>::walk
  20:     0x7ff8616c8b22 - rustc_middle[415f7117aa72a916]::util::bug::bug_fmt
  21:     0x7ff85eeab192 - <alloc[1bd79818fa64b571]::rc::Rc<rustc_mir_dataflow[3d6a567cba390439]::points::DenseLocationMap>>::drop_slow
  22:     0x7ff85e0db858 - <rustc_borrowck[94623f7bbe74a0e8]::region_infer::values::PlaceholderIndices>::lookup_index
  23:     0x7ff85e0e0ab8 - <rustc_borrowck[94623f7bbe74a0e8]::type_check::relate_tys::NllTypeRelating>::create_next_universe
  24:     0x7ff85ef92673 - <rustc_borrowck[94623f7bbe74a0e8]::type_check::TypeChecker as rustc_middle[415f7117aa72a916]::mir::visit::Visitor>::visit_rvalue
  25:     0x7ff85ef52dc5 - <rustc_borrowck[94623f7bbe74a0e8]::type_check::TypeChecker as rustc_middle[415f7117aa72a916]::mir::visit::Visitor>::visit_body
  26:     0x7ff85efcd078 - <rustc_borrowck[94623f7bbe74a0e8]::type_check::TypeChecker as rustc_middle[415f7117aa72a916]::mir::visit::Visitor>::visit_const_operand
  27:     0x7ff85e0db19a - <rustc_borrowck[94623f7bbe74a0e8]::region_infer::values::PlaceholderIndices>::lookup_index
  28:     0x7ff85ef06e34 - rustc_borrowck[94623f7bbe74a0e8]::mir_borrowck
  29:     0x7ff85f70d48b - rustc_query_impl[dbd98c1d837197ef]::plumbing::query_key_hash_verify_all
  30:     0x7ff85f649863 - RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtCsco0OWYSRcIH_21rustc_data_structures9vec_cache8VecCacheNtNtCs5K2xb0UU2Jw_10rustc_span6def_id10LocalDefIdINtNtNtCs5BYDmTWcnKQ
  31:     0x7ff85f717de5 - rustc_query_impl[dbd98c1d837197ef]::plumbing::query_key_hash_verify_all
  32:     0x7ff85e8250e3 - <rustc_interface[cdf4984d0e22fb97]::passes::LintStoreExpandImpl as rustc_expand[eb94a41e01d8b712]::base::LintStoreExpand>::pre_expansion_lint
  33:     0x7ff85adadb57 - rustc_interface[cdf4984d0e22fb97]::passes::analysis
  34:     0x7ff85e33e0ba - RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtCsco0OWYSRcIH_21rustc_data_structures9vec_cache8VecCacheNtNtCs5K2xb0UU2Jw_10rustc_span6def_id8CrateNumINtNtNtCs5BYDmTWcnKQ_12
  35:     0x7ff85e247a7c - RINvNtNtCs7IFNuxsOQZH_18rustc_query_system5query8plumbing17try_execute_queryINtCsiSfPmaTe9VX_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs5BYDmTWcnKQ_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  36:     0x7ff85e3445dc - rustc_query_impl[dbd98c1d837197ef]::query_system
  37:     0x7ff85ad6ecc5 - std[df32d1bc89881d89]::sys::backtrace::__rust_begin_short_backtrace::<<std[df32d1bc89881d89]::thread::Builder>::spawn_unchecked_<ctrlc[dac7a3742903fcef]::set_handler_inner<rustc_driver_impl[824051745b838893]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  38:     0x7ff85ad68f23 - std[df32d1bc89881d89]::sys::backtrace::__rust_begin_short_backtrace::<<std[df32d1bc89881d89]::thread::Builder>::spawn_unchecked_<ctrlc[dac7a3742903fcef]::set_handler_inner<rustc_driver_impl[824051745b838893]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  39:     0x7ff85ad647af - RINvNtNtCsja4ZeDc2XAj_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCshGilUj5gLc1_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCsbbk6E3yTTQl_17rustc_driver_i
  40:     0x7ff85ad73020 - std[df32d1bc89881d89]::sys::backtrace::__rust_begin_short_backtrace::<<std[df32d1bc89881d89]::thread::Builder>::spawn_unchecked_<ctrlc[dac7a3742903fcef]::set_handler_inner<rustc_driver_impl[824051745b838893]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  41:     0x7ff85e7c545d - alloc::boxed::impl$28::call_once
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\alloc\src\boxed.rs:1966
  42:     0x7ff85e7c545d - alloc::boxed::impl$28::call_once
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\alloc\src\boxed.rs:1966
  43:     0x7ff85e7c545d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library\std\src\sys\pal\windows\thread.rs:56
  44:     0x7ff9979de8d7 - BaseThreadInitThunk
  45:     0x7ff99919bf2c - RtlUserThreadStart

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.88.0 (6b00bc388 2025-06-23) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C opt-level=1 -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -C incremental=[REDACTED] -C link-arg=-fuse-ld=lld

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_borrowck] borrow-checking `event_handlers::<impl at resources\src\event_handlers.rs:93:1: 96:52>::handle_events`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `inox_resources` (lib)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions