@@ -2090,6 +2090,19 @@ pub struct MacroDef {
20902090 pub body : Box < DelimArgs > ,
20912091 /// `true` if macro was defined with `macro_rules`.
20922092 pub macro_rules : bool ,
2093+
2094+ /// If this is a macro used for externally implementable items,
2095+ /// it refers to an extern item which is its "target". This requires
2096+ /// name resolution so can't just be an attribute, so we store it in this field.
2097+ pub eii_extern_target : Option < EiiExternTarget > ,
2098+ }
2099+
2100+ #[ derive( Clone , Encodable , Decodable , Debug , HashStable_Generic , Walkable ) ]
2101+ pub struct EiiExternTarget {
2102+ /// path to the extern item we're targetting
2103+ pub extern_item_path : Path ,
2104+ pub impl_unsafe : bool ,
2105+ pub span : Span ,
20932106}
20942107
20952108#[ derive( Clone , Encodable , Decodable , Debug , Copy , Hash , Eq , PartialEq ) ]
@@ -3729,6 +3742,21 @@ pub struct Fn {
37293742 pub contract : Option < Box < FnContract > > ,
37303743 pub define_opaque : Option < ThinVec < ( NodeId , Path ) > > ,
37313744 pub body : Option < Box < Block > > ,
3745+
3746+ /// This function is an implementation of an externally implementable item (EII).
3747+ /// This means, there was an EII declared somewhere and this function is the
3748+ /// implementation that should be run when the declaration is called.
3749+ pub eii_impls : ThinVec < EiiImpl > ,
3750+ }
3751+
3752+ #[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
3753+ pub struct EiiImpl {
3754+ pub node_id : NodeId ,
3755+ pub eii_macro_path : Path ,
3756+ pub impl_safety : Safety ,
3757+ pub span : Span ,
3758+ pub inner_span : Span ,
3759+ pub is_default : bool ,
37323760}
37333761
37343762#[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
@@ -4095,7 +4123,7 @@ mod size_asserts {
40954123 static_assert_size ! ( Block , 32 ) ;
40964124 static_assert_size ! ( Expr , 72 ) ;
40974125 static_assert_size ! ( ExprKind , 40 ) ;
4098- static_assert_size ! ( Fn , 184 ) ;
4126+ static_assert_size ! ( Fn , 192 ) ;
40994127 static_assert_size ! ( ForeignItem , 80 ) ;
41004128 static_assert_size ! ( ForeignItemKind , 16 ) ;
41014129 static_assert_size ! ( GenericArg , 24 ) ;
0 commit comments