# Rust-analyzer crash : request handler panicked: \`&'^0 \[u8\]

**URL:** <https://internals.rust-lang.org/t/rust-analyzer-crash-request-handler-panicked-0-u8/24494>\
**Category:** tools and infrastructure\
**Created:** [July 27, 2026, 6:37pm UTC](https://internals.rust-lang.org/t/rust-analyzer-crash-request-handler-panicked-0-u8/24494 "2026-07-27T18:37:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rxdiscovery](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/rxdiscovery/32/11755_2.png) [@rxdiscovery](https://internals.rust-lang.org/u/rxdiscovery)\
**Post date:** [July 27, 2026, 6:37pm UTC](https://internals.rust-lang.org/t/rust-analyzer-crash-request-handler-panicked-0-u8/24494/1 "2026-07-27T18:37:09Z")

</div>

**Hi everyone,**

I'm encountering an issue where rust-analyzer consistently crashes on a valid .rs file. The code compiles without any errors, but rust-analyzer panics with the following crash report:

```rust
2026-07-27T19:16:10.905415502+01:00 WARN overly long loop turn took 146.327192ms:
(event handling took 112.931722ms): PrimeCaches(End { cancelled: false })
(cancellation took None)
                (garbage collection took Some(33.370289ms))

thread 'Worker7' (13760) panicked at crates/hir-ty/src/next_solver/predicate.rs:606:9:
`&'^0 [u8]: Copy` has escaping bound vars, so it cannot be wrapped in a dummy binder.
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <hir_ty::next_solver::infer::InferCtxt>::type_is_copy_modulo_regions
   3: <hir_ty::mir::lower::MirLowerCtx>::pop_drop_scope_internal
   4: <hir_ty::mir::lower::MirLowerCtx>::pop_drop_scope_assert_finished
   5: <hir_ty::mir::lower::_::mir_body_for_closure_query_Configuration_ as salsa::function::Configuration>::execute
   6: <salsa::function::IngredientImpl<hir_ty::mir::lower::_::mir_body_for_closure_query_Configuration_>>::execute
   7: hir_ty::mir::lower::mir_body_for_closure_query
   8: <ide_db::RootDatabase as hir_ty::db::HirDatabase>::mir_body_for_closure
   9: hir_ty::mir::borrowck::all_mir_bodies::for_closure::<<<hir_ty::InferBodyId>::borrowck::_::borrowck_query_Configuration_ as salsa::function::Configuration>::execute::inner_::{closure#0}, <<hir_ty::InferBodyId>::borrowck::_::borrowck_query_Configuration_ as salsa::function::Configuration>::execute::inner_::{closure#1}>
  10: <<hir_ty::InferBodyId>::borrowck::_::borrowck_query_Configuration_ as salsa::function::Configuration>::execute
  11: <salsa::function::IngredientImpl<<hir_ty::InferBodyId>::borrowck::_::borrowck_query_Configuration_>>::execute
  12: <hir_ty::InferBodyId>::borrowck
  13: <hir::DefWithBody>::diagnostics
  14: <hir::Module>::diagnostics
  15: ide_diagnostics::semantic_diagnostics
  16: ide_diagnostics::full_diagnostics
  17: <ide::Analysis>::full_diagnostics
  18: rust_analyzer::handlers::request::handle_document_diagnostics
  19: <<stdx::thread::pool::Pool>::spawn<<rust_analyzer::task_pool::TaskPool<rust_analyzer::main_loop::Task>>::spawn<<rust_analyzer::handlers::dispatch::RequestDispatcher>::on_with_thread_intent<false, false, gen_lsp_types::generated::requests::DocumentDiagnosticRequest>::{closure#0}>::{closure#0}>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stacktrace:
   0: mir_body_for_closure_query(Id(12e80c)) -> (R25450, Durability::LOW)
             at crates/hir-ty/src/mir/lower.rs:2111
   1: borrowck_query(Id(1282c4)) -> (R25450, Durability::LOW)
             at crates/hir-ty/src/mir/borrowck.rs:153

additional context:
   0: 
version: 0.3.2989-standalone
request: textDocument/diagnostic DocumentDiagnosticParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/xxxx/projects/xxxxx/code.rs",
            query: None,
            fragment: None,
        },
    },
    identifier: Some(
        "rust-analyzer",
    ),
    previous_result_id: Some(
        "rust-analyzer",
    ),
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

[Error - 7:16:11 PM] Request textDocument/diagnostic failed.
  Message: request handler panicked: `&'^0 [u8]: Copy` has escaping bound vars, so it cannot be wrapped in a dummy binder.
  Code: -32603 
[Error - 7:16:11 PM] Document pull failed for text document file:///home/xxxx/projects/xxxxx/code.rs
  Message: request handler panicked: `&'^0 [u8]: Copy` has escaping bound vars, so it cannot be wrapped in a dummy binder.
  Code: -32603 
2026-07-27T19:16:11.974286958+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision

```

By **systematically isolating the code** , I located the source of the issue. It appears that this version of `rust-analyzer` fails to process this particular code snippet :

```rust
   acceptor_builder.set_alpn_select_callback(|_, client_protos| {
                            match pingora::tls::ssl::select_next_proto(
                                b"\x02h2\x08http/1.1",
                                client_protos,
                            ) {
                                Some(proto) => Ok(proto),
                                None => Err(pingora::tls::ssl::AlpnError::NOACK),
                            }
                        });

```

* * *

I wrote this code to replicate the behavior causing the bug :

```rust
#[derive(Debug)]
pub struct CoreError;

impl CoreError {
    pub fn err_certificate_error(_msg: String) -> Self {
        CoreError
    }
}

pub enum AlpnError {
    NOACK,
}

pub struct SslMethod;
impl SslMethod {
    pub fn tls() -> Self {
        SslMethod
    }
}

pub struct SslError;
impl std::fmt::Display for SslError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "ssl error")
    }
}

pub struct SslAcceptor;
impl SslAcceptor {
    pub fn mozilla_intermediate(_method: SslMethod) -> Result<Self, SslError> {
        Ok(SslAcceptor)
    }

    pub fn set_alpn_select_callback<F>(&mut self, _callback: F)
    where
        F: for<'a> Fn(&mut (), &'a [u8]) -> Result<&'a [u8], AlpnError> + Send + Sync + 'static,
    {
    }
}

pub fn select_next_proto<'a>(_server: &[u8], client: &'a [u8]) -> Option<&'a [u8]> {
    Some(client)
}

// Simulation
pub fn main() {
    let mut acceptor_builder = SslAcceptor::mozilla_intermediate(SslMethod::tls())
        .map_err(|e| CoreError::err_certificate_error(e.to_string()))
        .unwrap();

    acceptor_builder.set_alpn_select_callback(|_, client_protos| {
        match select_next_proto(b"\x02h2\x08http/1.1", client_protos) {
            Some(proto) => Ok(proto),
            None => Err(AlpnError::NOACK),
        }
    });
}

```

### Rust version :

```rust

rustc : 1.97.1
cargo : 1.97.1

(IDE VSCODE) :
rust-analyzer : 0.3.2989

```

Does anyone have any insight into what might be causing this?

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![chrefr](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@chrefr](https://internals.rust-lang.org/u/chrefr)\
**Post date:** [July 27, 2026, 6:46pm UTC](https://internals.rust-lang.org/t/rust-analyzer-crash-request-handler-panicked-0-u8/24494/2 "2026-07-27T18:46:27Z")

</div>

When rust-analyzer crash, you should file an issue. Before doing that, please search for existing issues.

---

<div class="post-metadata">

**Author:** ![rxdiscovery](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/rxdiscovery/32/11755_2.png) [@rxdiscovery](https://internals.rust-lang.org/u/rxdiscovery)\
**Post date:** [July 27, 2026, 7:09pm UTC](https://internals.rust-lang.org/t/rust-analyzer-crash-request-handler-panicked-0-u8/24494/3 "2026-07-27T19:09:53Z")

</div>

@chrefrI opened an issue on GitHub :

> <https://github.com/rust-lang/rust-analyzer/issues/22935>
>
> Hello,
> 
> I'm encountering an issue where rust-analyzer consistently crashes on a …valid .rs file. The code compiles without any errors, but rust-analyzer panics with the following crash report:
> 
> 
> \`\`\`
> 2026-07-27T19:16:10.905415502+01:00 WARN overly long loop turn took 146.327192ms:
> (event handling took 112.931722ms): PrimeCaches(End { cancelled: false })
> (cancellation took None)
> (garbage collection took Some(33.370289ms))
> 
> thread 'Worker7' (13760) panicked at crates/hir-ty/src/next\_solver/predicate.rs:606:9:
> \`&'^0 \[u8\]: Copy\` has escaping bound vars, so it cannot be wrapped in a dummy binder.
> stack backtrace:
> 0: \_\_rustc::rust\_begin\_unwind
> 1: core::panicking::panic\_fmt
> 2: \<hir\_ty::next\_solver::infer::InferCtxt\>::type\_is\_copy\_modulo\_regions
> 3: \<hir\_ty::mir::lower::MirLowerCtx\>::pop\_drop\_scope\_internal
> 4: \<hir\_ty::mir::lower::MirLowerCtx\>::pop\_drop\_scope\_assert\_finished
> 5: \<hir\_ty::mir::lower::\_::mir\_body\_for\_closure\_query\_Configuration\_ as salsa::function::Configuration\>::execute
> 6: \<salsa::function::IngredientImpl\<hir\_ty::mir::lower::\_::mir\_body\_for\_closure\_query\_Configuration\_\>\>::execute
> 7: hir\_ty::mir::lower::mir\_body\_for\_closure\_query
> 8: \<ide\_db::RootDatabase as hir\_ty::db::HirDatabase\>::mir\_body\_for\_closure
> 9: hir\_ty::mir::borrowck::all\_mir\_bodies::for\_closure::\<\<\<hir\_ty::InferBodyId\>::borrowck::\_::borrowck\_query\_Configuration\_ as salsa::function::Configuration\>::execute::inner\_::{closure#0}, \<\<hir\_ty::InferBodyId\>::borrowck::\_::borrowck\_query\_Configuration\_ as salsa::function::Configuration\>::execute::inner\_::{closure#1}\>
> 10: \<\<hir\_ty::InferBodyId\>::borrowck::\_::borrowck\_query\_Configuration\_ as salsa::function::Configuration\>::execute
> 11: \<salsa::function::IngredientImpl\<\<hir\_ty::InferBodyId\>::borrowck::\_::borrowck\_query\_Configuration\_\>\>::execute
> 12: \<hir\_ty::InferBodyId\>::borrowck
> 13: \<hir::DefWithBody\>::diagnostics
> 14: \<hir::Module\>::diagnostics
> 15: ide\_diagnostics::semantic\_diagnostics
> 16: ide\_diagnostics::full\_diagnostics
> 17: \<ide::Analysis\>::full\_diagnostics
> 18: rust\_analyzer::handlers::request::handle\_document\_diagnostics
> 19: \<\<stdx::thread::pool::Pool\>::spawn\<\<rust\_analyzer::task\_pool::TaskPool\<rust\_analyzer::main\_loop::Task\>\>::spawn\<\<rust\_analyzer::handlers::dispatch::RequestDispatcher\>::on\_with\_thread\_intent\<false, false, gen\_lsp\_types::generated::requests::DocumentDiagnosticRequest\>::{closure#0}\>::{closure#0}\>::{closure#0} as core::ops::function::FnOnce\<()\>\>::call\_once::{shim:vtable#0}
> note: Some details are omitted, run with \`RUST\_BACKTRACE=full\` for a verbose backtrace.
> query stacktrace:
> 0: mir\_body\_for\_closure\_query(Id(12e80c)) -\> (R25450, Durability::LOW)
> at crates/hir-ty/src/mir/lower.rs:2111
> 1: borrowck\_query(Id(1282c4)) -\> (R25450, Durability::LOW)
> at crates/hir-ty/src/mir/borrowck.rs:153
> 
> additional context:
> 0: 
> version: 0.3.2989-standalone
> request: textDocument/diagnostic DocumentDiagnosticParams {
> text\_document: TextDocumentIdentifier {
> uri: Url {
> scheme: "file",
> cannot\_be\_a\_base: false,
> username: "",
> password: None,
> host: None,
> port: None,
> path: "/home/xxxx/projects/xxxxx/code.rs",
> query: None,
> fragment: None,
> },
> },
> identifier: Some(
> "rust-analyzer",
> ),
> previous\_result\_id: Some(
> "rust-analyzer",
> ),
> work\_done\_progress\_params: WorkDoneProgressParams {
> work\_done\_token: None,
> },
> partial\_result\_params: PartialResultParams {
> partial\_result\_token: None,
> },
> }
> 
> \[Error - 7:16:11 PM\] Request textDocument/diagnostic failed.
> Message: request handler panicked: \`&'^0 \[u8\]: Copy\` has escaping bound vars, so it cannot be wrapped in a dummy binder.
> Code: -32603 
> \[Error - 7:16:11 PM\] Document pull failed for text document file:///home/xxxx/projects/xxxxx/code.rs
> Message: request handler panicked: \`&'^0 \[u8\]: Copy\` has escaping bound vars, so it cannot be wrapped in a dummy binder.
> Code: -32603 
> 2026-07-27T19:16:11.974286958+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
> \`\`\`
> 
> 
> By \*\*systematically isolating the code\*\*, I located the source of the issue. It appears that this version of \`rust-analyzer\` fails to process this particular code snippet :  
> \`\`\`rust
> acceptor\_builder.set\_alpn\_select\_callback(|\_, client\_protos| {
> match pingora::tls::ssl::select\_next\_proto(
> b"\\x02h2\\x08http/1.1",
> client\_protos,
> ) {
> Some(proto) =\> Ok(proto),
> None =\> Err(pingora::tls::ssl::AlpnError::NOACK),
> }
> });
> \`\`\`
> 
> 
> I wrote this code to replicate the behavior causing the bug : 
> 
> \`\`\`rust
> \#\[derive(Debug)\]
> pub struct CoreError;
> 
> impl CoreError {
> pub fn err\_certificate\_error(\_msg: String) -\> Self {
> CoreError
> }
> }
> 
> pub enum AlpnError {
> NOACK,
> }
> 
> pub struct SslMethod;
> impl SslMethod {
> pub fn tls() -\> Self {
> SslMethod
> }
> }
> 
> pub struct SslError;
> impl std::fmt::Display for SslError {
> fn fmt(&self, f: &mut std::fmt::Formatter\<'\_\>) -\> std::fmt::Result {
> write!(f, "ssl error")
> }
> }
> 
> pub struct SslAcceptor;
> impl SslAcceptor {
> pub fn mozilla\_intermediate(\_method: SslMethod) -\> Result\<Self, SslError\> {
> Ok(SslAcceptor)
> }
> 
> pub fn set\_alpn\_select\_callback\<F\>(&mut self, \_callback: F)
> where
> F: for\<'a\> Fn(&mut (), &'a \[u8\]) -\> Result\<&'a \[u8\], AlpnError\> + Send + Sync + 'static,
> {
> }
> }
> 
> pub fn select\_next\_proto\<'a\>(\_server: &\[u8\], client: &'a \[u8\]) -\> Option\<&'a \[u8\]\> {
> Some(client)
> }
> 
> // Simulation
> pub fn main() {
> let mut acceptor\_builder = SslAcceptor::mozilla\_intermediate(SslMethod::tls())
> .map\_err(|e| CoreError::err\_certificate\_error(e.to\_string()))
> .unwrap();
> 
> acceptor\_builder.set\_alpn\_select\_callback(|\_, client\_protos| {
> match select\_next\_proto(b"\\x02h2\\x08http/1.1", client\_protos) {
> Some(proto) =\> Ok(proto),
> None =\> Err(AlpnError::NOACK),
> }
> });
> }
> 
> \`\`\`
> 
> \### Rust version :
> \`\`\`
> 
> rustc : 1.97.1
> cargo : 1.97.1
> 
> (IDE VSCODE) :
> rust-analyzer : 0.3.2989
> \`\`\`
>  
> Thanks in advance.

I wrote this code to replicate the behavior causing the bug :

> [@rxdiscovery](#):
>
> ```rust
> #[derive(Debug)]
> pub struct CoreError;
> 
> impl CoreError {
> pub fn err_certificate_error(_msg: String) -> Self {
> CoreError
> }
> }
> 
> pub enum AlpnError {
> NOACK,
> }
> 
> pub struct SslMethod;
> impl SslMethod {
> pub fn tls() -> Self {
> SslMethod
> }
> }
> 
> pub struct SslError;
> impl std::fmt::Display for SslError {
> fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
> write!(f, "ssl error")
> }
> }
> 
> pub struct SslAcceptor;
> impl SslAcceptor {
> pub fn mozilla_intermediate(_method: SslMethod) -> Result<Self, SslError> {
> Ok(SslAcceptor)
> }
> 
> pub fn set_alpn_select_callback<F>(&mut self, _callback: F)
> where
> F: for<'a> Fn(&mut (), &'a [u8]) -> Result<&'a [u8], AlpnError> + Send + Sync + 'static,
> {
> }
> }
> 
> pub fn select_next_proto<'a>(_server: &[u8], client: &'a [u8]) -> Option<&'a [u8]> {
> Some(client)
> }
> 
> // Simulation
> pub fn main() {
> let mut acceptor_builder = SslAcceptor::mozilla_intermediate(SslMethod::tls())
> .map_err(|e| CoreError::err_certificate_error(e.to_string()))
> .unwrap();
> 
> acceptor_builder.set_alpn_select_callback(|_, client_protos| {
> match select_next_proto(b"\x02h2\x08http/1.1", client_protos) {
> Some(proto) => Ok(proto),
> None => Err(AlpnError::NOACK),
> }
> });
> }
> 
> ```

@chrefr You can paste this code into the `main.rs` of an empty project. Make a quick change or add a comment to trigger rust-analyzer, then check the Rust-analyzer Language Server logs. You should see the crash report there

\*\*If you open the IDE directly on this code, it might spam the logs indefinitely until the IDE crashes : \*\*

```rust
...
...
2026-07-27T20:57:02.280577401+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.280841979+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.281142347+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.281403579+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.281666163+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.281957654+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.29421639+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.294495477+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.294769704+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.295073699+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.295369238+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
2026-07-27T20:57:02.295632925+01:00 WARN Propagating panic for cycle head that panicked in an earlier execution in that revision
...
...

```
