fix(derive): Disallow general attributes with from_global

This commit is contained in:
Ed Page 2022-09-06 11:41:03 -05:00
parent a71b2eb8b8
commit 222003abe1

View file

@ -786,8 +786,8 @@ impl Item {
}
}
if let Kind::Skip(_, attr) = &*self.kind {
if self.has_explicit_methods() {
if self.has_explicit_methods() {
if let Kind::Skip(_, attr) = &*self.kind {
abort!(
self.methods[0].name.span(),
"`{}` cannot be used with `#[{}(skip)]",
@ -795,6 +795,13 @@ impl Item {
attr.as_str(),
);
}
if let Kind::FromGlobal(_) = &*self.kind {
abort!(
self.methods[0].name.span(),
"`{}` cannot be used with `#[arg(from_global)]",
self.methods[0].name,
);
}
}
}