about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/lib.rs
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-08-08 14:22:45 -0500
committerGitHub <noreply@github.com>2025-08-08 14:22:45 -0500
commit804d1a194e8aafc4fbf3fc24250d77f2025f075e (patch)
treefa603908157012890b785a7c4ce13c0655002850 /compiler/rustc_resolve/src/lib.rs
parent18abf3aa44c53652c017752eda43f0405cd22c13 (diff)
parentf88839d2abc1c190c3072638518ff06b79686de1 (diff)
downloadrust-804d1a194e8aafc4fbf3fc24250d77f2025f075e.tar.gz
rust-804d1a194e8aafc4fbf3fc24250d77f2025f075e.zip
Rollup merge of #144579 - joshtriplett:mbe-attr, r=petrochenkov
Implement declarative (`macro_rules!`) attribute macros (RFC 3697)

This implements [RFC 3697](https://github.com/rust-lang/rust/issues/143547), "Declarative (`macro_rules!`) attribute macros".

I would suggest reading this commit-by-commit. This first introduces the
feature gate, then adds parsing for attribute rules (doing nothing with them),
then adds the ability to look up and apply `macro_rules!` attributes by path,
then adds support for local attributes, then adds a test, and finally makes
various improvements to errors.
Diffstat (limited to 'compiler/rustc_resolve/src/lib.rs')
-rw-r--r--compiler/rustc_resolve/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index e5df23a86cb..23f44ff1658 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -1029,13 +1029,14 @@ struct DeriveData {
 
 struct MacroData {
     ext: Arc<SyntaxExtension>,
+    attr_ext: Option<Arc<SyntaxExtension>>,
     nrules: usize,
     macro_rules: bool,
 }
 
 impl MacroData {
     fn new(ext: Arc<SyntaxExtension>) -> MacroData {
-        MacroData { ext, nrules: 0, macro_rules: false }
+        MacroData { ext, attr_ext: None, nrules: 0, macro_rules: false }
     }
 }