about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2025-09-28 09:15:02 -0700
committerJosh Triplett <josh@joshtriplett.org>2025-10-01 16:19:39 -0700
commit4fc0a0d42a66e9b248fa527f7f063ec7226803dd (patch)
treeb9527b122d5e1d1424dfe3fb4fca9c7c59bea1d6 /compiler
parentea0e00c5738f56970ad3ed3cc3d27c19715cd9ea (diff)
downloadrust-4fc0a0d42a66e9b248fa527f7f063ec7226803dd.tar.gz
rust-4fc0a0d42a66e9b248fa527f7f063ec7226803dd.zip
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.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_expand/src/expand.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs
index a035896d554..3dfa3cdcc35 100644
--- a/compiler/rustc_expand/src/expand.rs
+++ b/compiler/rustc_expand/src/expand.rs
@@ -841,6 +841,9 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
                         Err(guar) => return ExpandResult::Ready(fragment_kind.dummy(span, guar)),
                     }
                 } else if let SyntaxExtensionKind::LegacyAttr(expander) = ext {
+                    // `LegacyAttr` is only used for builtin attribute macros, which have their
+                    // safety checked by `check_builtin_meta_item`, so we don't need to check
+                    // `unsafety` here.
                     match validate_attr::parse_meta(&self.cx.sess.psess, &attr) {
                         Ok(meta) => {
                             let item_clone = macro_stats.then(|| item.clone());