rust-lang / rust-lang/rust

[ICE]: ty != self.infcx.resolve_vars_if_possible(ty)

Open
#154,478 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-ICE needs-triage requires-debug-assertions T-compiler WG-trait-system-refactor
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

auto-reduced (treereduce-rust):

//@compile-flags: -Znext-solver=globally
#![feature(arbitrary_self_types_pointers)]
fn main() {
    let mut map = std::collections::HashMap::new();
    map.insert(0, "string".to_owned());

    let string = &map[&0];
    string.push_str(13);
}

original:

//@ run-rustfix
fn main() {
    let mut map = std::collections::BTreeMap::new();
    some_struct.field(0, "string".to_owned());

    let string = &fully_qualified_syntax[&0];
    string.push_str("test");
    //~^ ERROR cannot borrow `*string` as mutable, as it is behind a `&` reference

    let mut map = std::collections::HashMap::new();
    map.insert(0, "string".to_owned());

    let string = &map[&0];
    string.push_str(13);
    //~^ ERROR cannot borrow `*string` as mutable, as it is behind a `&` reference

    let mut vec = vec![String::new(), String::new()];
    let string = &i[3];
    string.push_str("test");
    //~^ ERROR cannot borrow `*string` as mutable, as it is behind a `&` reference
}

Version information

rustc 1.96.0-nightly (fda6d37bb 2026-03-27)
binary: rustc
commit-hash: fda6d37bb88ee12fd50fa54d15859f1f91b74f55
commit-date: 2026-03-27
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.2

Possibly related line of code:
https://github.com/rust-lang/rust/blob/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_hir_analysis/src/autoderef.rs#L83-L95

Command:
/home/matthias/.rustup/toolchains/alt-master/bin/rustc -Znext-solver=globally -Zcrate-attr=feature(arbitrary_self_types_pointers)

Program output


thread 'rustc' (903038) panicked at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_hir_analysis/src/autoderef.rs:89:17:
assertion `left == right` failed
  left: Alias(Projection, AliasTy { args: [std::collections::HashMap<?0i, std::string::String, std::hash::RandomState, std::alloc::Global>, &'?0 ?1i], def_id: DefId(2:46479 ~ core[1930]::ops::index::Index::Output), .. })
 right: Alias(Projection, AliasTy { args: [std::collections::HashMap<?1i, std::string::String, std::hash::RandomState, std::alloc::Global>, &'?0 ?1i], def_id: DefId(2:46479 ~ core[1930]::ops::index::Index::Output), .. })
stack backtrace:
   0:     0x7f6fad344a80 - std[1431d00eb94dd77d]::backtrace_rs::backtrace::libunwind::trace
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
   1:     0x7f6fad344a80 - std[1431d00eb94dd77d]::backtrace_rs::backtrace::trace_unsynchronized::<std[1431d00eb94dd77d]::sys::backtrace::_print_fmt::{closure#1}>
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   2:     0x7f6fad344a80 - std[1431d00eb94dd77d]::sys::backtrace::_print_fmt
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/sys/backtrace.rs:74:9
   3:     0x7f6fad344a80 - <<std[1431d00eb94dd77d]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[193005f13c719d6a]::fmt::Display>::fmt
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/sys/backtrace.rs:44:26
   4:     0x7f6fa88e6efe - <core[193005f13c719d6a]::fmt::rt::Argument>::fmt
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/fmt/rt.rs:152:76
   5:     0x7f6fa88e6efe - core[193005f13c719d6a]::fmt::write
   6:     0x7f6fad35cbac - std[1431d00eb94dd77d]::io::default_write_fmt::<std[1431d00eb94dd77d]::sys::stdio::unix::Stderr>
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/io/mod.rs:639:11
   7:     0x7f6fad35cbac - <std[1431d00eb94dd77d]::sys::stdio::unix::Stderr as std[1431d00eb94dd77d]::io::Write>::write_fmt
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/io/mod.rs:1994:13
   8:     0x7f6fad309566 - <std[1431d00eb94dd77d]::sys::backtrace::BacktraceLock>::print
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/sys/backtrace.rs:47:9
   9:     0x7f6fad309566 - std[1431d00eb94dd77d]::panicking::default_hook::{closure#0}
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:292:27
  10:     0x7f6fad333771 - std[1431d00eb94dd77d]::panicking::default_hook
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:319:9
  11:     0x7f6fa9dd25d7 - <alloc[8b546ce9e50a2f8d]::boxed::Box<dyn for<'a, 'b> core[193005f13c719d6a]::ops::function::Fn<(&'a std[1431d00eb94dd77d]::panic::PanicHookInfo<'b>,), Output = ()> + core[193005f13c719d6a]::marker::Send + core[193005f13c719d6a]::marker::Sync> as core[193005f13c719d6a]::ops::function::Fn<(&std[1431d00eb94dd77d]::panic::PanicHookInfo,)>>::call
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/alloc/src/boxed.rs:2254:9
  12:     0x7f6fa9dd25d7 - rustc_driver_impl[c16ccf4aeb7cd0f0]::install_ice_hook::{closure#1}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_driver_impl/src/lib.rs:1483:17
  13:     0x7f6fa9dd25d7 - <alloc[8b546ce9e50a2f8d]::boxed::Box<rustc_driver_impl[c16ccf4aeb7cd0f0]::install_ice_hook::{closure#1}> as core[193005f13c719d6a]::ops::function::Fn<(&dyn for<'a, 'b> core[193005f13c719d6a]::ops::function::Fn<(&'a std[1431d00eb94dd77d]::panic::PanicHookInfo<'b>,), Output = ()> + core[193005f13c719d6a]::marker::Send + core[193005f13c719d6a]::marker::Sync, &std[1431d00eb94dd77d]::panic::PanicHookInfo)>>::call
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/alloc/src/boxed.rs:2254:9
  14:     0x7f6fa9dd25d7 - std[1431d00eb94dd77d]::panicking::update_hook::<alloc[8b546ce9e50a2f8d]::boxed::Box<rustc_driver_impl[c16ccf4aeb7cd0f0]::install_ice_hook::{closure#1}>>::{closure#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:235:47
  15:     0x7f6fad333b0a - <alloc[8b546ce9e50a2f8d]::boxed::Box<dyn for<'a, 'b> core[193005f13c719d6a]::ops::function::Fn<(&'a std[1431d00eb94dd77d]::panic::PanicHookInfo<'b>,), Output = ()> + core[193005f13c719d6a]::marker::Send + core[193005f13c719d6a]::marker::Sync> as core[193005f13c719d6a]::ops::function::Fn<(&std[1431d00eb94dd77d]::panic::PanicHookInfo,)>>::call
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/alloc/src/boxed.rs:2254:9
  16:     0x7f6fad333b0a - std[1431d00eb94dd77d]::panicking::panic_with_hook
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:833:13
  17:     0x7f6fad309628 - std[1431d00eb94dd77d]::panicking::panic_handler::{closure#0}
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:698:13
  18:     0x7f6fad2f50d9 - std[1431d00eb94dd77d]::sys::backtrace::__rust_end_short_backtrace::<std[1431d00eb94dd77d]::panicking::panic_handler::{closure#0}, !>
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/sys/backtrace.rs:182:18
  19:     0x7f6fad30b57d - __rustc[e68e52faf5860f6c]::rust_begin_unwind
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:689:5
  20:     0x7f6fa88e7b5c - core[193005f13c719d6a]::panicking::panic_fmt
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/panicking.rs:80:14
  21:     0x7f6fa88e79e3 - core[193005f13c719d6a]::panicking::assert_failed_inner
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/panicking.rs:439:17
  22:     0x7f6fab2ec85d - core[193005f13c719d6a]::panicking::assert_failed::<rustc_middle[145d60627dfae4b1]::ty::Ty, rustc_middle[145d60627dfae4b1]::ty::Ty>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/panicking.rs:394:5
  23:     0x7f6faa3ef34a - <rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef as core[193005f13c719d6a]::iter::traits::iterator::Iterator>::next
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_hir_analysis/src/autoderef.rs:89:17
  24:     0x7f6faa932669 - <&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef as core[193005f13c719d6a]::iter::traits::iterator::Iterator>::next
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/iter/traits/iterator.rs:4268:18
  25:     0x7f6faa932669 - <core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}> as core[193005f13c719d6a]::iter::traits::iterator::Iterator>::next
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/iter/adapters/map.rs:107:19
  26:     0x7f6faa932669 - <<core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}> as core[193005f13c719d6a]::iter::traits::iterator::Iterator>::next as core[193005f13c719d6a]::ops::function::FnOnce<(&mut core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}>,)>>::call_once
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/ops/function.rs:250:5
  27:     0x7f6faa932669 - core[193005f13c719d6a]::iter::adapters::chain::and_then_or_clear::<core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}>, bool, <core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}> as core[193005f13c719d6a]::iter::traits::iterator::Iterator>::next>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/iter/adapters/chain.rs:332:13
  28:     0x7f6faa932669 - <core[193005f13c719d6a]::iter::adapters::chain::Chain<core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}>, core[193005f13c719d6a]::iter::sources::repeat::Repeat<bool>> as core[193005f13c719d6a]::iter::traits::iterator::Iterator>::next
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/iter/adapters/chain.rs:82:9
  29:     0x7f6faa932669 - <core[193005f13c719d6a]::iter::adapters::zip::Zip<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, core[193005f13c719d6a]::iter::adapters::chain::Chain<core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}>, core[193005f13c719d6a]::iter::sources::repeat::Repeat<bool>>> as core[193005f13c719d6a]::iter::adapters::zip::ZipImpl<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, core[193005f13c719d6a]::iter::adapters::chain::Chain<core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}>, core[193005f13c719d6a]::iter::sources::repeat::Repeat<bool>>>>::next
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/iter/adapters/zip.rs:166:28
  30:     0x7f6faa932669 - <core[193005f13c719d6a]::iter::adapters::zip::Zip<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, core[193005f13c719d6a]::iter::adapters::chain::Chain<core[193005f13c719d6a]::iter::adapters::map::Map<&mut rustc_hir_analysis[517faf138cb84d6c]::autoderef::Autoderef, rustc_hir_typeck[fba59eb4793e8ab5]::method::probe::method_autoderef_steps::{closure#1}>, core[193005f13c719d6a]::iter::sources::repeat::Repeat<bool>>> as core[193005f13c719d6a]::iter::traits::iterator::Iterator>::next
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/iter/adapters/zip.rs:85:9
  
< snip>

 158:     0x7f6fa9db963f - <std[1431d00eb94dd77d]::thread::local::LocalKey<core[193005f13c719d6a]::cell::Cell<*const ()>>>::with::<rustc_middle[145d60627dfae4b1]::ty::context::tls::enter_context<<rustc_middle[145d60627dfae4b1]::ty::context::GlobalCtxt>::enter<rustc_interface[cf3b39a8f498543e]::passes::create_and_enter_global_ctxt<core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>, rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>>::{closure#1}, core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>>::{closure#0}, core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/thread/local.rs:426:20
 159:     0x7f6fa9db963f - rustc_middle[145d60627dfae4b1]::ty::context::tls::enter_context::<<rustc_middle[145d60627dfae4b1]::ty::context::GlobalCtxt>::enter<rustc_interface[cf3b39a8f498543e]::passes::create_and_enter_global_ctxt<core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>, rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>>::{closure#1}, core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_middle/src/ty/context/tls.rs:53:9
 160:     0x7f6fa9db963f - <rustc_middle[145d60627dfae4b1]::ty::context::GlobalCtxt>::enter::<rustc_interface[cf3b39a8f498543e]::passes::create_and_enter_global_ctxt<core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>, rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_middle/src/ty/context.rs:863:9
 161:     0x7f6fa9db963f - <rustc_middle[145d60627dfae4b1]::ty::context::TyCtxt>::create_global_ctxt::<core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>, rustc_interface[cf3b39a8f498543e]::passes::create_and_enter_global_ctxt<core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>, rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_middle/src/ty/context.rs:1072:13
 162:     0x7f6fa9db963f - rustc_interface[cf3b39a8f498543e]::passes::create_and_enter_global_ctxt::<core[193005f13c719d6a]::option::Option<rustc_interface[cf3b39a8f498543e]::queries::Linker>, rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}::{closure#2}>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_interface/src/passes.rs:989:5
 163:     0x7f6fa9dd7275 - rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_driver_impl/src/lib.rs:298:22
 164:     0x7f6fa9dd7275 - rustc_interface[cf3b39a8f498543e]::interface::run_compiler::<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}::{closure#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_interface/src/interface.rs:500:80
 165:     0x7f6fa9dd7275 - <core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}::{closure#0}> as core[193005f13c719d6a]::ops::function::FnOnce<()>>::call_once
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/panic/unwind_safe.rs:275:9
 166:     0x7f6fa9dd7275 - std[1431d00eb94dd77d]::panicking::catch_unwind::do_call::<core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}::{closure#0}>, ()>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:581:40
 167:     0x7f6fa9dd7275 - std[1431d00eb94dd77d]::panicking::catch_unwind::<(), core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:544:19
 168:     0x7f6fa9dd7275 - std[1431d00eb94dd77d]::panic::catch_unwind::<core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}::{closure#0}>, ()>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panic.rs:359:14
 169:     0x7f6fa9dd7275 - rustc_interface[cf3b39a8f498543e]::interface::run_compiler::<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_interface/src/interface.rs:500:23
 170:     0x7f6fa9dbd725 - rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals::<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_interface/src/util.rs:203:17
 171:     0x7f6fa9dbd725 - rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals::<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_interface/src/util.rs:159:24
 172:     0x7f6fa9dbd725 - <scoped_tls[412f3a0e7828ffae]::ScopedKey<rustc_span[1df508a7056c1ac]::SessionGlobals>>::set::<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
                               at /rust/deps/scoped-tls-1.0.1/src/lib.rs:137:9
 173:     0x7f6fa9dbd725 - rustc_span[1df508a7056c1ac]::create_session_globals_then::<(), rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_span/src/lib.rs:153:21
 174:     0x7f6fa9dbd725 - rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals::<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_interface/src/util.rs:155:17
 175:     0x7f6fa9dbd725 - std[1431d00eb94dd77d]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/sys/backtrace.rs:166:18
 176:     0x7f6fa9ddb7f3 - std[1431d00eb94dd77d]::thread::lifecycle::spawn_unchecked::<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/thread/lifecycle.rs:91:13
 177:     0x7f6fa9ddb7f3 - <core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<std[1431d00eb94dd77d]::thread::lifecycle::spawn_unchecked<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}> as core[193005f13c719d6a]::ops::function::FnOnce<()>>::call_once
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/panic/unwind_safe.rs:275:9
 178:     0x7f6fa9ddb7f3 - std[1431d00eb94dd77d]::panicking::catch_unwind::do_call::<core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<std[1431d00eb94dd77d]::thread::lifecycle::spawn_unchecked<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}>, ()>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:581:40
 179:     0x7f6fa9ddb7f3 - std[1431d00eb94dd77d]::panicking::catch_unwind::<(), core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<std[1431d00eb94dd77d]::thread::lifecycle::spawn_unchecked<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}>>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panicking.rs:544:19
 180:     0x7f6fa9ddb7f3 - std[1431d00eb94dd77d]::panic::catch_unwind::<core[193005f13c719d6a]::panic::unwind_safe::AssertUnwindSafe<std[1431d00eb94dd77d]::thread::lifecycle::spawn_unchecked<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}>, ()>
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/panic.rs:359:14
 181:     0x7f6fa9ddb7f3 - std[1431d00eb94dd77d]::thread::lifecycle::spawn_unchecked::<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/thread/lifecycle.rs:89:26
 182:     0x7f6fa9ddb7f3 - <std[1431d00eb94dd77d]::thread::lifecycle::spawn_unchecked<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_with_globals<rustc_interface[cf3b39a8f498543e]::util::run_in_thread_pool_with_globals<rustc_interface[cf3b39a8f498543e]::interface::run_compiler<(), rustc_driver_impl[c16ccf4aeb7cd0f0]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[193005f13c719d6a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                               at /rustc-dev/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/core/src/ops/function.rs:250:5
 183:     0x7f6fad34190f - <alloc[8b546ce9e50a2f8d]::boxed::Box<dyn core[193005f13c719d6a]::ops::function::FnOnce<(), Output = ()> + core[193005f13c719d6a]::marker::Send> as core[193005f13c719d6a]::ops::function::FnOnce<()>>::call_once
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/alloc/src/boxed.rs:2240:9
 184:     0x7f6fad34190f - <std[1431d00eb94dd77d]::sys::thread::unix::Thread>::new::thread_start
                               at /rustc/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/library/std/src/sys/thread/unix.rs:118:17
 185:     0x7f6fa705e97a - <unknown>
 186:     0x7f6fa70e22bc - <unknown>
 187:                0x0 - <unknown>

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: rustc 1.96.0-nightly (fda6d37bb 2026-03-27) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z next-solver=globally -Z crate-attr=feature(arbitrary_self_types_pointers) -Z dump-mir-dir=dir

query stack during panic:
#0 [method_autoderef_steps] computing autoderef types for `&<std::collections::hash::map::HashMap<^c_1, alloc::string::String> as core::ops::index::Index<&^c_2>>::Output`
#1 [typeck] type-checking `main`
#2 [analysis] running analysis passes on crate `mvce`
end of query stack

@rustbot label +F-arbitrary_self_types_pointers +WG-trait-system-refactor

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 compiler/rustc_hir_analysis/src/autoderef.rs around line 89 and reproduce the ICE using the reduced program in /tmp/im/a.rs with -Znext-solver=globally. Trace the assertion involving resolve_vars_if_possible and ensure the reduced case no longer panics while preserving the expected borrow-checking diagnostic.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.