Stream: t-compiler/rust-analyzer

Topic: proc-macro not expanded


Martin Asquino (Dec 16 2020 at 16:11, on Zulip):

Hey all! I'm getting a lot of proc-macro not expanded warnings from rust-analyzer and they seem to be specifically in the derives for serde in my case. #[derive(Serialize, Deserialize)] those trigger that warning. I thought that maye meant that I had that derive added but I never really used it (as in, never serialized or deserialized it), but that doesn't seem to be the case. I must be missing something, but I can't understand what.

Florian Diebold (Dec 16 2020 at 16:12, on Zulip):

do you have the rust-analyzer.procMacro.enable and rust-analyzer.cargo.loadOutDirsFromCheck settings enabled?

Jonas Schievink [he/him] (Dec 16 2020 at 16:14, on Zulip):

It means that rust-analyzer was not able to expand the procedural macro because it wasn't found. This is usually a benign diagnostic and can be ignored if you have not enabled procedural macro support (hence being only a "hint", not a warning).

Martin Asquino (Dec 16 2020 at 16:15, on Zulip):

I only have rust-analyzer.diagnostics.disable = ["proc-macro"] because it also seemed to add a bunch of errors that I couldn't make sense of, but that's all I have in terms of rust-analyzer settings.

Jonas Schievink [he/him] (Dec 16 2020 at 16:54, on Zulip):

That diagnostic code does not exist, did you mean "macro-error"?

Last update: Jul 27 2021 at 21:15UTC