Highlight unresolved derives as being unresolved

This commit is contained in:
Lukas Wirth 2023-03-08 13:51:14 +01:00
parent b4bd27be90
commit b6e7cf3201
4 changed files with 6 additions and 4 deletions

View file

@ -538,8 +538,8 @@ impl<'db> SemanticsImpl<'db> {
}
fn expand_derive_as_pseudo_attr_macro(&self, attr: &ast::Attr) -> Option<SyntaxNode> {
let src = self.wrap_node_infile(attr.clone());
let adt = attr.syntax().parent().and_then(ast::Adt::cast)?;
let src = self.wrap_node_infile(attr.clone());
let call_id = self.with_ctx(|ctx| {
ctx.attr_to_derive_macro_call(src.with_value(&adt), src).map(|(_, it, _)| it)
})?;