0

I join these two questions in one, as they maybe are related. A few days ago, I started having this error in the [#actix_rt::main] line, before the main function:

proc macro `main` not expanded: cannot find proc-macro server in sysroot `C:\Users\zerok\.rustup\toolchains\stable-x86_64-pc-windows-gnu`

At the same time, in VSCode my rust-analyzer extension started failing. I uninstalled it, restarted VSCode, and reinstalled. It keeps giving the same error over and over:

Failed to spawn one or more proc-macro servers.

How can I fix this problem?

Alen Paul Varghese
  • 1,278
  • 14
  • 27
Zerok
  • 1,323
  • 1
  • 24
  • 56

1 Answers1

2

Soon after posting the question, I finally found out how to install the toolchain, which seems to have fixed both errors:

rustup toolchain install stable-x86_64-pc-windows-gnu

After that, I clicked on the rust-analyzer box on the bottom of VSCode, clicked in "Restart Server", and everything worked after the command completion.

Zerok
  • 1,323
  • 1
  • 24
  • 56
  • Good to know: proc macro expansion is no longer supported in toolchains older than 1.64 - you can check your toolchain version using `rustc -V`. See [this discussion](https://github.com/rust-lang/rust-analyzer/issues/14554#issuecomment-1505626832) – pedropedro Jun 27 '23 at 08:59