rust-lang / rust-lang/rust

Compiler panic during "evaluating trait selection obligation"

Open
#149,385 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-incr-comp C-bug I-ICE T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I encountered a compiler error, though it doesn't happen all the time. Even with just adding some meaningless whitespace I only get the error around 50% of the time. Trying to minimize it the panic doesn't happen anymore :(

Code
use brush_render::MainBackend;
use brush_render::camera::Camera;
use brush_render::gaussian_splats::Splats;
use brush_train::config::TrainConfig;
use brush_train::train::SplatTrainer;
use burn_autodiff::Autodiff;
use burn_core::module::AutodiffModule;
use burn_wgpu::WgpuDevice;
use glam::f32::vec3;
use glam::u32::uvec2;

type DiffBackend = Autodiff<MainBackend>;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let device = WgpuDevice::DefaultDevice;

    let splats =
        Splats::<DiffBackend>::from_raw(vec![0.0, 0.0, 0.0], None, None, None, None, &device);

    let camera = Camera {
        fov_x: 10.0,
        fov_y: 10.0,
        center_uv: Default::default(),
        position: Default::default(),
        rotation: Default::default(),
    };

    let (rgb, _) = splats
        .valid()
        .render(&camera, uvec2(1, 1), vec3(0.0, 0.0, 0.0), None);

    // Export rgb
    dbg!(rgb.dtype());
    dbg!(rgb.into_data().dtype);

    let mut splat_trainer = SplatTrainer::new(&TrainConfig::default(), &device, splats).await;
    //splat_trainer.step()

    println!("Einde");
    Ok(())
}

Meta

rustc --version --verbose:

rustc 1.93.0-nightly (1be6b13be 2025-11-26)
binary: rustc
commit-hash: 1be6b13be73dc12e98e51b403add4c41a0b77759
commit-date: 2025-11-26
host: aarch64-apple-darwin
release: 1.93.0-nightly
LLVM version: 21.1.5
Error output

error: internal compiler error: encountered incremental compilation error with evaluate_obligation(fcc672b079f4c123-2a16a3fcd11c62)
  |
  = note: please follow the instructions below to create a bug report with the provided information
  = note: for incremental compilation bugs, having a reproduction is vital
  = note: an ideal reproduction consists of the code before and some patch that then triggers the bug when applied and compiled again
  = note: as a workaround, you can run `cargo clean -p true_ortho` or `cargo clean` to allow your project to compile

thread 'rustc' (4817783) panicked at /rustc-dev/1be6b13be73dc12e98e51b403add4c41a0b77759/compiler/rustc_query_system/src/query/plumbing.rs:752:9:
Found unstable fingerprints for evaluate_obligation(fcc672b079f4c123-2a16a3fcd11c62): Err(Canonical)
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_query_system::query::plumbing::incremental_verify_ich_failed::<rustc_middle::ty::context::TyCtxt>
   3: rustc_query_system::query::plumbing::incremental_verify_ich::<rustc_middle::ty::context::TyCtxt, rustc_middle::query::erase::Erased<[u8; 2]>>
   4: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_type_ir::canonical::CanonicalQueryInput<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::predicate::Predicate>>, rustc_middle::query::erase::Erased<[u8; 2]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
   5: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
   6: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
   7: rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions
   8: rustc_ty_utils::common_traits::is_item_raw
      [... omitted 2 frames ...]
   9: <rustc_middle::ty::Ty>::is_sized
  10: rustc_ty_utils::layout::layout_of
      [... omitted 2 frames ...]
  11: <rustc_middle::ty::layout::LayoutCx as rustc_middle::ty::layout::LayoutOf>::spanned_layout_of
  12: rustc_ty_utils::abi::fn_abi_new_uncached::{closure#2}
  13: <core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::iter::adapters::chain::Chain<core::iter::adapters::chain::Chain<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Ty>>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Ty>>>, core::option::IntoIter<rustc_middle::ty::Ty>>>, rustc_ty_utils::abi::fn_abi_new_uncached::{closure#3}>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::FnAbiError>> as core::iter::traits::iterator::Iterator>::next
  14: rustc_ty_utils::abi::fn_abi_new_uncached
  15: rustc_ty_utils::abi::fn_abi_of_instance
      [... omitted 2 frames ...]
  16: <rustc_codegen_llvm::context::GenericCx<rustc_codegen_llvm::context::FullCx> as rustc_middle::ty::layout::FnAbiOf>::fn_abi_of_instance
  17: <rustc_codegen_llvm::context::GenericCx<rustc_codegen_llvm::context::FullCx> as rustc_codegen_ssa::traits::declare::PreDefineCodegenMethods>::predefine_fn
  18: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  19: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  20: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  21: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  22: <rustc_interface::queries::Linker>::codegen_and_build_linker
  23: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  24: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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/paul/mastools/rustc-ice-2025-11-27T14_15_00-22368.txt` to your bug report
note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `lpips::VggBlockRecord<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_cubecl::backend::CubeBackend<cubecl_wgpu::runtime::WgpuRuntime, f32, i32, u32>>>>: core::marker::Sized`
#1 [is_sized_raw] computing whether `lpips::VggBlockRecord<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_cubecl::backend::CubeBackend<cubecl_wgpu::runtime::WgpuRuntime, f32, i32, u32>>>>` is `Sized`
#2 [layout_of] computing layout of `*mut lpips::VggBlockRecord<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_cubecl::backend::CubeBackend<cubecl_wgpu::runtime::WgpuRuntime, f32, i32, u32>>>>`
#3 [fn_abi_of_instance] computing call ABI of `core::ptr::drop_in_place::<lpips::VggBlockRecord<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_cubecl::backend::CubeBackend<cubecl_wgpu::runtime::WgpuRuntime, f32, i32, u32>>>>> - shim(Some(lpips::VggBlockRecord<burn_autodiff::backend::Autodiff<burn_fusion::backend::Fusion<burn_cubecl::backend::CubeBackend<cubecl_wgpu::runtime::WgpuRuntime, f32, i32, u32>>>>))`
end of query stack
Backtrace

rustc-ice-2025-11-27T14_15_00-22368.txt
Cargo.lock.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied Rust example, Cargo.lock.zip, attached ICE log, and rustc 1.93.0-nightly details; reproduce the intermittent failure with incremental compilation and compare it after cargo clean. Follow the evaluate_obligation query stack in the reported compiler paths and check whether the issue persists on the latest nightly. Done means a stable minimal reproduction or a confirmed compiler regression test and fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.