Skip to content

Commit 42c3f40

Browse files
committed
mbe: expand_invoc: Add comment about not needing to check safety of LegacyAttr here
`LegacyAttr` is only used for builtin attributes, and builtin attributes have their safety checked by `check_attribute_safety`, so we don't need to check `unsafety` here.
1 parent 119666a commit 42c3f40

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_expand/src/expand.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,9 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
842842
Err(guar) => return ExpandResult::Ready(fragment_kind.dummy(span, guar)),
843843
}
844844
} else if let SyntaxExtensionKind::LegacyAttr(expander) = ext {
845+
// `LegacyAttr` is only used for builtin attribute macros, which have their
846+
// safety checked by `check_builtin_meta_item`, so we don't need to check
847+
// `unsafety` here.
845848
match validate_attr::parse_meta(&self.cx.sess.psess, &attr) {
846849
Ok(meta) => {
847850
let item_clone = macro_stats.then(|| item.clone());

0 commit comments

Comments
 (0)