Disallow unsafe in derive

This commit is contained in:
carbotaniuman 2024-04-23 07:50:53 -05:00
parent 67f5dd1ef1
commit c4de986afa
6 changed files with 37 additions and 2 deletions

View file

@ -778,7 +778,8 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
if let SyntaxExtensionKind::Derive(..) = ext {
self.gate_proc_macro_input(&item);
}
// FIX THIS LATER
// The `MetaItem` representing the trait to derive can't
// have an unsafe around it (as of now).
let meta = ast::MetaItem {
unsafety: ast::Unsafe::No,
kind: MetaItemKind::Word,