Skip to content

proc macro server crashes for certain macros #8148

Description

@lenscas

Continuation from https://www.reddit.com/r/rust/comments/makwv3/rustanalyzer_changelog_69/grt1kul?utm_source=share&utm_medium=web2x&context=3

For some reason the embed_compiler macro from tealr_derive causes the macro server to crash for me. I think I nailed it down to that macro specifically because it only crashes if I have the test for that macro open. The moment I have that test file open the server crashes and a macro that used to work will give me the same error from that point onwards. Only way to get back to a working state is by closing the embed_compiler test file and telling vscode to reload the window.

The proc macro that causes the problem: https://github.com/lenscas/tealr/blob/cee2363a14c53b995a69efb2b4cbd84010905276/tealr_derive/src/lib.rs#L242

the test that causes the crash: https://github.com/lenscas/tealr/blob/master/tealr/tests/embed_teal.rs
The test that doesn't crash:https://github.com/lenscas/tealr/blob/master/tealr/tests/function_wrapper.rs

For what it is worth, the compile_inline_teal macro gives me the type &{unknown} back according to rust analyzer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macromacro expansionS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions