rust-lang / rust-lang/rust-analyzer

panic:`OutlivesPredicate(..)` has escaping bound vars, so it cannot be wrapped in a dummy binder.

Open
#22,882 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-lifetimes C-bug I-panic
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

impl<'a, 'b, 'c: 'a + 'b, T> ZeroCopyFrom<[T]> for &'static [T] {
    fn zero_copy_from<'c>()   {
        todo!()
    }
}

~/.rustup/toolchains/master/bin/rust-analyzer highlight < code.rs

thread 'main' (472617) panicked at src/tools/rust-analyzer/crates/hir-ty/src/lower.rs:862:21:
`OutlivesPredicate(#0, '^0.Named(FunctionId("zero_copy_from")))` has escaping bound vars, so it cannot be wrapped in a dummy binder.
stack backtrace:
   0:     0x7fb18a81f986 - <<std[14b872c6dbd886e0]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a6950792ababbd1]::fmt::Display>::fmt
   1:     0x7fb18ae0d908 - core[a6950792ababbd1]::fmt::write
   2:     0x7fb18a834adc - <std[14b872c6dbd886e0]::sys::stdio::unix::Stderr as core[a6950792ababbd1]::io::write::Write>::write_fmt
   3:     0x7fb18a7f15ba - std[14b872c6dbd886e0]::panicking::default_hook::{closure#0}
   4:     0x7fb18a812023 - std[14b872c6dbd886e0]::panicking::default_hook
   5:     0x7fb18a81248b - std[14b872c6dbd886e0]::panicking::panic_with_hook
   6:     0x7fb18a7f1672 - std[14b872c6dbd886e0]::panicking::panic_handler::{closure#0}
   7:     0x7fb18a7e8009 - std[14b872c6dbd886e0]::sys::backtrace::__rust_end_short_backtrace::<std[14b872c6dbd886e0]::panicking::panic_handler::{closure#0}, !>
   8:     0x7fb18a7f2fcd - __rustc[d223ed2f55e2e6b0]::rust_begin_unwind
   9:     0x7fb18739fd0c - core[a6950792ababbd1]::panicking::panic_fmt
  10:     0x5597629cde4f - <hir_ty[5d72008b13b2c614]::lower::TyLoweringContext>::lower_where_predicate
  11:     0x55976295a9fd - <salsa[dc22b664093bf419]::function::IngredientImpl<<hir_ty[5d72008b13b2c614]::lower::GenericPredicates>::query_with_diagnostics::_::query_with_diagnostics__Configuration_>>::execute
  12:     0x55976293a2d6 - <salsa[dc22b664093bf419]::function::IngredientImpl<<hir_ty[5d72008b13b2c614]::lower::GenericPredicates>::query_with_diagnostics::_::query_with_diagnostics__Configuration_>>::fetch
  13:     0x55976272765f - <salsa[dc22b664093bf419]::attach::Attached>::attach::<dyn hir_ty[5d72008b13b2c614]::db::HirDatabase, &hir_ty[5d72008b13b2c614]::lower::TyLoweringResult<hir_ty[5d72008b13b2c614]::lower::GenericPredicates>, <hir_ty[5d72008b13b2c614]::lower::GenericPredicates>::query_with_diagnostics::query_with_diagnostics_::{closure#0}>
  14:     0x559762b177d7 - <hir_ty[5d72008b13b2c614]::lower::trait_environment::_::trait_environment_query_Configuration_ as salsa[dc22b664093bf419]::function::Configuration>::execute
  15:     0x559762969774 - <salsa[dc22b664093bf419]::function::IngredientImpl<hir_ty[5d72008b13b2c614]::lower::trait_environment::_::trait_environment_query_Configuration_>>::execute
  16:     0x559762a72806 - hir_ty[5d72008b13b2c614]::lower::trait_environment
  17:     0x559762a1dab3 - <hir_ty[5d72008b13b2c614]::infer::InferenceContext>::new
  18:     0x559762a70b7c - hir_ty[5d72008b13b2c614]::infer::infer_query_with_inspect
  19:     0x559762960464 - <salsa[dc22b664093bf419]::function::IngredientImpl<<hir_ty[5d72008b13b2c614]::infer::InferenceResult>::for_body::_::for_body__Configuration_>>::execute
  20:     0x559762727c47 - <salsa[dc22b664093bf419]::attach::Attached>::attach::<dyn hir_ty[5d72008b13b2c614]::db::HirDatabase, &hir_ty[5d72008b13b2c614]::infer::InferenceResult, <hir_ty[5d72008b13b2c614]::infer::InferenceResult>::for_body::for_body_::{closure#0}>
  21:     0x55976237a02c - <hir[d93e9080096ec767]::semantics::SemanticsImpl>::get_unsafe_ops
  22:     0x559762cf6113 - ide[f5854e1c26aef566]::syntax_highlighting::highlight
  23:     0x559762d3316e - ide[f5854e1c26aef566]::syntax_highlighting::html::highlight_as_html_with_config
  24:     0x559762c9786c - <ide[f5854e1c26aef566]::Analysis>::highlight_as_html
  25:     0x559763749182 - <rust_analyzer[47e7db669456c698]::cli::flags::Highlight>::run
  26:     0x55976397d354 - rust_analyzer[e832f3322db99818]::main
  27:     0x5597639795c3 - std[14b872c6dbd886e0]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[a6950792ababbd1]::result::Result<std[14b872c6dbd886e0]::process::ExitCode, anyhow[3651e52fea1bebe0]::Error>, core[a6950792ababbd1]::result::Result<std[14b872c6dbd886e0]::process::ExitCode, anyhow[3651e52fea1bebe0]::Error>>
  28:     0x55976397b322 - std[14b872c6dbd886e0]::rt::lang_start::<core[a6950792ababbd1]::result::Result<std[14b872c6dbd886e0]::process::ExitCode, anyhow[3651e52fea1bebe0]::Error>>::{closure#0}
  29:     0x7fb18c0064dd - std[14b872c6dbd886e0]::rt::lang_start_internal
  30:     0x559763993dc8 - main
  31:     0x7fb185627741 - <unknown>
  32:     0x7fb185627879 - __libc_start_main
  33:     0x559762277079 - <unknown>
  34:                0x0 - <unknown>

rust-analyzer 1.99.0-nightly (f65b272 2026-07-21)

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

Reproduce the crash with rust-analyzer highlight < code.rs using the Rust snippet from the issue. Start at src/tools/rust-analyzer/crates/hir-ty/src/lower.rs:862, especially lower_where_predicate, and trace the syntax-highlighting path shown in the backtrace. Done means this input no longer panics during highlighting.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, devtools
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.