From a522b63a900d8732761630df99e8529ef199091a Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <barracuda@macos-powerpc.org>
Date: Sat, 25 Jul 2026 16:44:06 +0000
Subject: [PATCH 24/30] parse: accept interpolated :item fragments inside trait
 bodies

Parse_Trait_Item had no TOK_INTERPOLATED_ITEM case, so a macro_rules
that captures `$item:item` and re-emits it inside a `trait { }` body
died with "Unexpected token TOK_INTERPOLATED_ITEM:Function". Mirrors
the handling Parse_Impl_Item already has. Seen with os_str_bytes 6.6.1
(`deprecated_conversions!` wrapping trait method declarations).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GNXc7PddzJE4X1swqbe3Xn
---
 src/parse/root.cpp | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/parse/root.cpp b/src/parse/root.cpp
index 59b04df6..6716cd39 100644
--- a/src/parse/root.cpp
+++ b/src/parse/root.cpp
@@ -761,6 +761,25 @@ AST::Named<AST::Item> Parse_Trait_Item(TokenStream& lex)
         }
     }
 
+    if( lex.lookahead(0) == TOK_INTERPOLATED_ITEM ) {
+        tok = lex.getToken();
+        auto rv = tok.take_frag_item();
+        TU_MATCH_HDRA((rv.data), {)
+        default:
+            TODO(lex.point_span(), "Interpolated item into trait: " << rv.data.tag_str());
+        TU_ARMA(Function, e) {
+            }
+        TU_ARMA(Static, e) {
+            }
+        TU_ARMA(Type, e) {
+            }
+        }
+        // Transfer new attributes onto the item
+        for(auto& mi : item_attrs.m_items)
+            rv.attrs.m_items.push_back( mv$(mi) );
+        return rv;
+    }
+
     GET_TOK(tok, lex);
     bool is_specialisable = false;
     if( tok.type() == TOK_IDENT && tok.ident().name == "default" ) {
-- 
2.43.0

