Skip to content

Crash in the semantic db #18936

@Bben01

Description

@Bben01

rust-analyzer version: 0.3.2237-standalone (59bc7b4 2024-12-29)
rustc 1.83.0 (90b35a623 2024-11-26)
VSCode version: 1.95.3 (macOS)

Minimal reproduction: https://github.com/Bben01/rust-analyser-rename-bugs/blob/bdc4c6127262974e554bbb147258d053d7949f8d/src/proc_macro_static.rs

The backtrace

thread 'Worker' panicked at crates/hir/src/semantics.rs:1728:13:


Failed to lookup TRAIT@0..14 in this Semantics.
Make sure to use only query nodes, derived from this instance of Semantics.
root node:   MACRO_ITEMS@0..101
known nodes: SOURCE_FILE@0..116, MACRO_ITEMS@0..6480, MACRO_ITEMS@0..279, MACRO_ITEMS@0..814, MACRO_ITEMS@0..72


stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: hir::semantics::SemanticsImpl::find_file
   3: ide_db::defs::NameClass::classify
   4: ide_db::search::FindUsages::search
   5: hashbrown::raw::RawIterRange<T>::fold_impl
   6: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
   7: ide::highlight_related::highlight_related
   8: ra_salsa::Cancelled::catch
   9: rust_analyzer::handlers::request::handle_document_highlight
  10: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 19:00:16] Request textDocument/documentHighlight failed.
  Message: request handler panicked: 

Failed to lookup TRAIT@0..14 in this Semantics.
Make sure to use only query nodes, derived from this instance of Semantics.
root node:   MACRO_ITEMS@0..101
known nodes: SOURCE_FILE@0..116, MACRO_ITEMS@0..6480, MACRO_ITEMS@0..279, MACRO_ITEMS@0..814, MACRO_ITEMS@0..72

Metadata

Metadata

Assignees

No one assigned

    Labels

    Broken WindowBugs / technical debt to be addressed immediatelyC-bugCategory: bugI-panic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions