rust-lang / rust-lang/rust-analyzer

Is it possible to display the backtrace when a proc macro panics?

Open
#17,563 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-proc-macro C-support
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

I use rust-analyzer via an extension for VS Code.

I'd like to be able to see the backtrace for the panic that happened during macro expansion.

Capture

How can I make it happen?

P.S.

I'd like to get the backtrace so that I can see the line where the panic occurred and where in the call stack the problem was introduced.

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

Start by reproducing a proc macro panic through rust-analyzer's VS Code extension and inspect how the proc-macro expansion failure is currently reported. The issue names no source file or test; done means exposing a backtrace that identifies the panic line and the relevant call stack.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.