Skip to content

Commit 4fc0a0d

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 ea0e00c commit 4fc0a0d

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
@@ -841,6 +841,9 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
841841
Err(guar) => return ExpandResult::Ready(fragment_kind.dummy(span, guar)),
842842
}
843843
} else if let SyntaxExtensionKind::LegacyAttr(expander) = ext {
844+
// `LegacyAttr` is only used for builtin attribute macros, which have their
845+
// safety checked by `check_builtin_meta_item`, so we don't need to check
846+
// `unsafety` here.
844847
match validate_attr::parse_meta(&self.cx.sess.psess, &attr) {
845848
Ok(meta) => {
846849
let item_clone = macro_stats.then(|| item.clone());

0 commit comments

Comments
 (0)