rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Navigate to symbol doesn't work inside of a macro

Open solomatov opened this issue 6 months ago • 2 comments

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P) 0.3.2474-standalone

rustc version: (eg. output of rustc -V)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable) VSCODE

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME) None

repository link (if public, optional): (eg. rust-analyzer)

  • https://github.com/rust-lang/rust-analyzer
  • revision ed608f592e0a038db4d03ed4af58fd171bd3b3c0qqq
  • file crates/hir/src/display.rs
  • line 247: write!(f, "{}", self.name(f.db).display(f.db, f.edition()))?;
  • put the cursor on na|me(f.db), and press F12, nothing happens

solomatov avatar May 28 '25 14:05 solomatov

I can't reproduce.

ChayimFriedman2 avatar May 29 '25 00:05 ChayimFriedman2

@ChayimFriedman2 In the console, there's a panic which is the same as in the other issue, i.e.

thread 'Worker8' panicked at /github/home/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/chalk-ir-0.102.0/src/debug.rs:156:13:
not implemented: cannot format ProjectionTy without setting Program in tls
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <&T as core::fmt::Debug>::fmt
   3: core::fmt::write
   4: <tracing_subscriber::fmt::format::DefaultVisitor as tracing_core::field::Visit>::record_debug
   5: tracing_core::field::ValueSet::record
   6: <tracing_subscriber::fmt::format::Format<tracing_subscriber::fmt::format::Full,T> as tracing_subscriber::fmt::format::FormatEvent<S,N>>::format_event
   7: std::thread::local::LocalKey<T>::with
   8: <tracing_subscriber::fmt::fmt_layer::Layer<S,N,E,W> as tracing_subscriber::layer::Layer<S>>::on_event
   9: std::thread::local::LocalKey<T>::with
  10: <tracing_subscriber::filter::layer_filters::Filtered<L,F,S> as tracing_subscriber::layer::Layer<S>>::on_event
  11: <tracing_subscriber::layer::layered::Layered<L,S> as tracing_core::subscriber::Subscriber>::event
  12: <tracing_subscriber::layer::layered::Layered<L,S> as tracing_core::subscriber::Subscriber>::event
  13: chalk_solve::clauses::builder::ClauseBuilder<I>::push_binders
  14: chalk_solve::clauses::program_clauses_that_could_match
  15: chalk_recursive::solve::SolveIteration::solve_iteration
  16: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  17: chalk_recursive::solve::SolveIteration::solve_iteration
  18: <chalk_recursive::recursive::RecursiveSolver<I> as chalk_solve::solve::Solver<I>>::solve_limited
  19: hir_ty::traits::trait_solve_query
  20: salsa::function::execute::<impl salsa::function::IngredientImpl<C>>::execute
  21: salsa::function::fetch::<impl salsa::function::IngredientImpl<C>>::fetch_cold_with_retry
  22: std::thread::local::LocalKey<T>::with
  23: <DB as hir_ty::db::HirDatabase>::trait_solve::trait_solve_shim
  24: <DB as hir_ty::db::HirDatabase>::trait_solve
  25: hir_ty::infer::unify::InferenceTable::register_obligation_in_env
  26: hir_ty::infer::unify::InferenceTable::normalize_projection_ty
  27: hir_ty::autoderef::deref_by_trait
  28: <hir_ty::autoderef::Autoderef<T> as core::iter::traits::iterator::Iterator>::next
  29: hir_ty::method_resolution::autoderef_method_receiver
  30: hir_ty::method_resolution::iterate_method_candidates_dyn
  31: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  32: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  33: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  34: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  35: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
  36: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  37: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  38: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  39: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
  40: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  41: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_return
  42: hir_ty::infer::infer_query
  43: salsa::function::execute::<impl salsa::function::IngredientImpl<C>>::execute
  44: salsa::function::fetch::<impl salsa::function::IngredientImpl<C>>::fetch_cold_with_retry
  45: salsa::function::fetch::<impl salsa::function::IngredientImpl<C>>::fetch
  46: <DB as hir_ty::db::HirDatabase>::infer::infer_shim
  47: hir::semantics::SemanticsImpl::analyze_impl
  48: hir::semantics::SemanticsImpl::resolve_macro_call2
  49: hir::semantics::SemanticsImpl::resolve_macro_call
  50: ide_assists::handlers::term_search::term_search
  51: ide_assists::assists
  52: salsa::cancelled::Cancelled::catch
  53: ide::Analysis::assists_with_fixes
  54: rust_analyzer::handlers::request::handle_code_action
  55: core::ops::function::FnOnce::call_once{{vtable.shim}}
  56: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stacktrace:

solomatov avatar May 29 '25 01:05 solomatov

Closed it, since it's probably obsolete.

solomatov avatar Nov 01 '25 22:11 solomatov