Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't expand any proc macros in current nightly: Failed to expand the macro: a procedural macro error occurred: #9048

Closed
ForsakenHarmony opened this issue Jul 12, 2022 · 6 comments · Fixed by #9058
Assignees
Labels
subsystem::proc-macros Issues related to procedural macros

Comments

@ForsakenHarmony
Copy link
Contributor

ForsakenHarmony commented Jul 12, 2022

Environment

  • IntelliJ Rust plugin version: 0.4.175.4741-222-nightly
  • Rust toolchain version: 1.64.0-nightly (c396bb3b8 2022-07-10) x86_64-pc-windows-msvc
  • IDE name and version: CLion 2022.2 EAP (CL-222.3345.16)
  • Operating system: Windows 10 10.0
  • Macro expansion engine: new
  • Name resolution engine: new
  • Additional experimental features: org.rust.cargo.features.settings.gutter, org.rust.cargo.emulate.terminal, org.rust.cargo.evaluate.build.scripts, org.rust.macros.proc

Problem description

intellij-rust doesn't expand any macros, doesn't matter which project or which crates contain the macros (e.g. serde::Serialize)

I get the error message Failed to expand the macro: a procedural macro error occurred: (nothing after the colon)

Steps to reproduce

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Test {
	pub id:    u64,
	pub name:  String,
}
@ForsakenHarmony
Copy link
Contributor Author

Still happening with 0.4.175.4744-222-nightly

@ForsakenHarmony
Copy link
Contributor Author

It works with an older version of rust (I have nightly-2022-04-12 installed)

@Undin Undin added the subsystem::proc-macros Issues related to procedural macros label Jul 12, 2022
@ForsakenHarmony
Copy link
Contributor Author

ForsakenHarmony commented Jul 13, 2022

Just tried going back to rust 1.63.0-nightly (nightly-2022-06-25), but it still fails

@ForsakenHarmony
Copy link
Contributor Author

Just debugged the extension, and it seems the error that comes back from the native helper is just "<unknown error>"

@ForsakenHarmony
Copy link
Contributor Author

May be related to rust-lang/rust-analyzer#12600

@vlad20012
Copy link
Member

vlad20012 commented Jul 13, 2022

Breakdowns of proc macros on the nightly Rust are absolutely usual, unfortunately. We even going to specially detect them and show more informative messages (see #8930). More robust solutions are discussed here.

You can use stable Rust or try to find a nightly version that works.
This specific issue will be fixed by #9058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem::proc-macros Issues related to procedural macros
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants