Create a rustc_ast representation for parsed attributes

This commit is contained in:
Jonathan Brouwer 2025-12-26 20:54:15 +01:00
parent da476f1942
commit 03fb7eeced
No known key found for this signature in database
GPG key ID: F13E55D38C971DEF
11 changed files with 115 additions and 48 deletions

View file

@ -813,10 +813,10 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
};
let attr_item = attr.get_normal_item();
let safety = attr_item.unsafety;
if let AttrArgs::Eq { .. } = attr_item.args {
if let AttrArgs::Eq { .. } = attr_item.args.unparsed_ref().unwrap() {
self.cx.dcx().emit_err(UnsupportedKeyValue { span });
}
let inner_tokens = attr_item.args.inner_tokens();
let inner_tokens = attr_item.args.unparsed_ref().unwrap().inner_tokens();
match expander.expand_with_safety(self.cx, safety, span, inner_tokens, tokens) {
Ok(tok_result) => {
let fragment = self.parse_ast_fragment(