Skip to content

False positive "proc macro not expanded" error when using any derive helpers #12582

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

Closed
jonas-schievink opened this issue Jun 18, 2022 · 2 comments · Fixed by #12584
Closed

False positive "proc macro not expanded" error when using any derive helpers #12582

jonas-schievink opened this issue Jun 18, 2022 · 2 comments · Fixed by #12584
Labels
A-diagnostics diagnostics / error reporting A-macro macro expansion Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug

Comments

@jonas-schievink
Copy link
Contributor

#[derive(serde::Serialize)]
#[serde(rename = "abc")]
struct S;

This reports an error on the #[serde] attribute with "proc macro serde not expanded: proc macro not found", even though the code is valid.

@jonas-schievink jonas-schievink added A-macro macro expansion A-diagnostics diagnostics / error reporting Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug labels Jun 18, 2022
@Veykril
Copy link
Member

Veykril commented Jun 18, 2022

Ah this is probably caused by this branch

_ => {
self.def_map.diagnostics.push(DefDiagnostic::unresolved_proc_macro(
directive.module_id,
MacroCallKind::Attr {
ast_id,
attr_args: Default::default(),
invoc_attr_index: attr.id.ast_index,
is_derive: false,
},
None,
));
return true;
}

Actually no, we shouldn't hit this here huh

@Veykril
Copy link
Member

Veykril commented Jun 18, 2022

Actually I can't reproduce this.

Edit: Huh I can in r-a, but not in a standalone project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting A-macro macro expansion Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants