@@ -2109,6 +2109,19 @@ pub struct MacroDef {
21092109 pub body : Box < DelimArgs > ,
21102110 /// `true` if macro was defined with `macro_rules`.
21112111 pub macro_rules : bool ,
2112+
2113+ /// If this is a macro used for externally implementable items,
2114+ /// it refers to an extern item which is its "target". This requires
2115+ /// name resolution so can't just be an attribute, so we store it in this field.
2116+ pub eii_extern_target : Option < EiiExternTarget > ,
2117+ }
2118+
2119+ #[ derive( Clone , Encodable , Decodable , Debug , HashStable_Generic , Walkable ) ]
2120+ pub struct EiiExternTarget {
2121+ /// path to the extern item we're targetting
2122+ pub extern_item_path : Path ,
2123+ pub impl_unsafe : bool ,
2124+ pub span : Span ,
21122125}
21132126
21142127#[ derive( Clone , Encodable , Decodable , Debug , Copy , Hash , Eq , PartialEq ) ]
@@ -3748,6 +3761,21 @@ pub struct Fn {
37483761 pub contract : Option < Box < FnContract > > ,
37493762 pub define_opaque : Option < ThinVec < ( NodeId , Path ) > > ,
37503763 pub body : Option < Box < Block > > ,
3764+
3765+ /// This function is an implementation of an externally implementable item (EII).
3766+ /// This means, there was an EII declared somewhere and this function is the
3767+ /// implementation that should be run when the declaration is called.
3768+ pub eii_impls : ThinVec < EiiImpl > ,
3769+ }
3770+
3771+ #[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
3772+ pub struct EiiImpl {
3773+ pub node_id : NodeId ,
3774+ pub eii_macro_path : Path ,
3775+ pub impl_safety : Safety ,
3776+ pub span : Span ,
3777+ pub inner_span : Span ,
3778+ pub is_default : bool ,
37513779}
37523780
37533781#[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
@@ -4114,7 +4142,7 @@ mod size_asserts {
41144142 static_assert_size ! ( Block , 32 ) ;
41154143 static_assert_size ! ( Expr , 72 ) ;
41164144 static_assert_size ! ( ExprKind , 40 ) ;
4117- static_assert_size ! ( Fn , 184 ) ;
4145+ static_assert_size ! ( Fn , 192 ) ;
41184146 static_assert_size ! ( ForeignItem , 80 ) ;
41194147 static_assert_size ! ( ForeignItemKind , 16 ) ;
41204148 static_assert_size ! ( GenericArg , 24 ) ;
0 commit comments