[ICE]: `Tracking borrow behind shared reference.`

Abierto
#165,604 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
compilers

Línea de trabajo

Start with the reproducer in the issue body and the referenced code in compiler/rustc_borrowck/src/places_conflict.rs around lines 226–238. Reproduce the ICE with the provided nightly compiler command, then trace the borrow-checking path that reaches the panic. Done means the reproducer produces a compiler diagnostic or compiles without an internal compiler error.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

C-bug F-reborrow I-ICE needs-triage T-compiler

snippet:

#![feature(reborrow)]
use std::marker::{PhantomData, Reborrow};
#[derive(Reborrow)]
struct CustomMarker<'a>(PhantomData<&'a ()>);
fn method<'a>(_a: CustomMarker) -> &'a () {
    todo!()
}
fn main() {
    let mut a = CustomMarker(PhantomData);
    let b = &a;
    let _ = method(*b);
}

Version information

rustc 1.102.0-nightly (e30d778f3 2026-11-07)
binary: rustc
commit-hash: e30d778f3029b78bb9c2e0dbe11a3b7389b652c4
commit-date: 2026-11-07
host: x86_64-unknown-linux-gnu
release: 1.102.0-nightly
LLVM version: 23.1.5

Possibly related line of code:
https://github.com/rust-lang/rust/blob/e30d778f3029b78bb9c2e0dbe11a3b7389b652c4/compiler/rustc_borrowck/src/places_conflict.rs#L226-L238

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

`--edition` is unspecified, defaulting to `2015` while the latest is `2024`; it must be one of: <2015|2018|2021|2024|future>

error: internal compiler error: /rustc-dev/e30d778f3029b78bb9c2e0dbe11a3b7389b652c4/compiler/rustc_borrowck/src/places_conflict.rs:232:21: Tracking borrow behind shared reference.


thread 'rustc' (2614827) panicked at /rustc-dev/e30d778f3029b78bb9c2e0dbe11a3b7389b652c4/compiler/rustc_borrowck/src/places_conflict.rs:232:21:
Box<dyn Any>
stack backtrace:
   0:     0x7fafb1bb1b46 - <<std[78fff3269c571d64]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[ab05fe898412e670]::fmt::Display>::fmt
   1:     0x7fafb2210d0f - core[ab05fe898412e670]::fmt::write
   2:     0x7fafb1bc66fc - <std[78fff3269c571d64]::sys::stdio::unix::Stderr as core[ab05fe898412e670]::io::write::Write>::write_fmt
   3:     0x7fafb1b82c5a - std[78fff3269c571d64]::panicking::default_hook::{closure#0}
   4:     0x7fafb1ba54a3 - std[78fff3269c571d64]::panicking::default_hook
   5:     0x7fafb094bf19 - std[78fff3269c571d64]::panicking::update_hook::<alloc[cce08dc9b884395a]::boxed::Box<rustc_driver_impl[81060cdeec855cdc]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fafb1ba5942 - std[78fff3269c571d64]::panicking::panic_with_hook
   7:     0x7fafb17423cd - std[78fff3269c571d64]::panicking::begin_panic::<rustc_span[a3f41dffa4d3a048]::macros::ExplicitBug>::{closure#0}
   8:     0x7fafb1740426 - std[78fff3269c571d64]::sys::backtrace::__rust_end_short_backtrace::<std[78fff3269c571d64]::panicking::begin_panic<rustc_span[a3f41dffa4d3a048]::macros::ExplicitBug>::{closure#0}, !>
   9:     0x7fafb173facb - std[78fff3269c571d64]::panicking::begin_panic::<rustc_span[a3f41dffa4d3a048]::macros::ExplicitBug>
  10:     0x7fafae0d4aa1 - rustc_span[a3f41dffa4d3a048]::macros::bug_impl
  11:     0x7fafb22ba87a - rustc_borrowck[844e9863c7f9bfb9]::get_flow_results
  12:     0x7fafb3545fe2 - rustc_borrowck[844e9863c7f9bfb9]::borrowck_check_region_constraints
  13:     0x7fafb353f19e - <rustc_borrowck[844e9863c7f9bfb9]::root_cx::BorrowCheckRootCtxt>::do_mir_borrowck
  14:     0x7fafb25ee015 - rustc_borrowck[844e9863c7f9bfb9]::mir_borrowck
  15:     0x7fafb25edd27 - rustc_query_impl[34f6a597f1724d62]::query_vtables::mir_borrowck::invoke_provider_fn::__rust_begin_short_backtrace
  16:     0x7fafb25ec74e - rustc_query_impl[34f6a597f1724d62]::execution::try_execute_query::<rustc_data_structures[930b7a29102cf109]::vec_cache::VecCache<rustc_span[a3f41dffa4d3a048]::def_id::LocalDefId, rustc_middle[a84b5397e30ac3fc]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[a84b5397e30ac3fc]::dep_graph::graph::DepNodeIndex>, false>
  17:     0x7fafb25ec2a7 - rustc_query_impl[34f6a597f1724d62]::query_vtables::mir_borrowck::execute_query_non_incr::__rust_end_short_backtrace
  18:     0x7fafb25ea363 - <rustc_middle[a84b5397e30ac3fc]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[23b467da62203591]::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  19:     0x7fafb25e96b8 - rustc_interface[23b467da62203591]::passes::analysis
  20:     0x7fafb3360287 - rustc_query_impl[34f6a597f1724d62]::execution::try_execute_query::<rustc_middle[a84b5397e30ac3fc]::query::caches::SingleCache<rustc_middle[a84b5397e30ac3fc]::query::erase::ErasedData<[u8; 0usize]>>, false>
  21:     0x7fafb336006b - rustc_query_impl[34f6a597f1724d62]::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace
  22:     0x7fafb342ef58 - rustc_interface[23b467da62203591]::interface::run_compiler::<(), rustc_driver_impl[81060cdeec855cdc]::compiler_entrypoint::{closure#0}>::{closure#2}
  23:     0x7fafb34e4b01 - std[78fff3269c571d64]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[23b467da62203591]::util::run_in_thread_with_globals<rustc_interface[23b467da62203591]::util::run_in_thread_pool_with_globals<rustc_interface[23b467da62203591]::interface::run_compiler<(), rustc_driver_impl[81060cdeec855cdc]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  24:     0x7fafb34e48ad - <std[78fff3269c571d64]::thread::lifecycle::spawn_unchecked<rustc_interface[23b467da62203591]::util::run_in_thread_with_globals<rustc_interface[23b467da62203591]::util::run_in_thread_pool_with_globals<rustc_interface[23b467da62203591]::interface::run_compiler<(), rustc_driver_impl[81060cdeec855cdc]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[ab05fe898412e670]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7fafb34e84ad - <std[78fff3269c571d64]::sys::thread::unix::Thread>::new::thread_start
  26:     0x7fafac498042 - <unknown>
  27:     0x7fafac52072c - <unknown>
  28:                0x0 - <unknown>

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.102.0-nightly (e30d778f3 2026-11-07) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `main`
#1 [analysis] running analysis passes on crate `mvce`
end of query stack
error: aborting due to 1 previous error


@rustbot label +F-reborrow

Lenguaje dominante
Rust
Estrellas
121k
Forks
17.3k
Merge medio
2 d 21 h
PR fusionados (30 d)
531

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rust-lang/rust

Todos los issues de rust-lang/rust

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.