[ICE]: `Tracking borrow behind shared reference.`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Rust
- Stars
- 121k
- Forks
- 17.3k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 531
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/rust
-
A-run-make relnotes relnotes-needs-review relnotes-tracking-issue T-lang T-libs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-libs
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
A-LLVM O-Arm O-UEFI O-x86_64 relnotes relnotes-needs-review relnotes-tracking-issue T-compiler
Difficulty 1/5 Under an hour Newbie friendliness 72/100
rust-lang/rust#165504 · 1 comment ·
Maintainers usually reply within 1 day
-
relnotes relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
unclear wording in vec macroPossibly taken @Suhird claimed this 5 days ago. OpenA-docs A-slice-vec T-libs
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
rust-lang/rust#165360 · 6 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
bytecodealliance/rustix#1736 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
longbridge/gpui-kit#3871 ·
Maintainers usually reply within 1 day
-
area:models enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 84/100
servo/rust-smallvec#864 ·