@@ -2066,6 +2066,19 @@ pub struct MacroDef {
20662066 pub body : Box < DelimArgs > ,
20672067 /// `true` if macro was defined with `macro_rules`.
20682068 pub macro_rules : bool ,
2069+
2070+ /// If this is a macro used for externally implementable items,
2071+ /// it refers to an extern item which is its "target". This requires
2072+ /// name resolution so can't just be an attribute, so we store it in this field.
2073+ pub eii_extern_target : Option < EiiExternTarget > ,
2074+ }
2075+
2076+ #[ derive( Clone , Encodable , Decodable , Debug , HashStable_Generic , Walkable ) ]
2077+ pub struct EiiExternTarget {
2078+ /// path to the extern item we're targetting
2079+ pub extern_item_path : Path ,
2080+ pub impl_unsafe : bool ,
2081+ pub span : Span ,
20692082}
20702083
20712084#[ derive( Clone , Encodable , Decodable , Debug , Copy , Hash , Eq , PartialEq ) ]
@@ -3691,6 +3704,21 @@ pub struct Fn {
36913704 pub contract : Option < Box < FnContract > > ,
36923705 pub define_opaque : Option < ThinVec < ( NodeId , Path ) > > ,
36933706 pub body : Option < Box < Block > > ,
3707+
3708+ /// This function is an implementation of an externally implementable item (EII).
3709+ /// This means, there was an EII declared somewhere and this function is the
3710+ /// implementation that should be run when the declaration is called.
3711+ pub eii_impls : ThinVec < EiiImpl > ,
3712+ }
3713+
3714+ #[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
3715+ pub struct EiiImpl {
3716+ pub node_id : NodeId ,
3717+ pub eii_macro_path : Path ,
3718+ pub impl_safety : Safety ,
3719+ pub span : Span ,
3720+ pub inner_span : Span ,
3721+ pub is_default : bool ,
36943722}
36953723
36963724#[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
@@ -4038,7 +4066,7 @@ mod size_asserts {
40384066 static_assert_size ! ( Block , 32 ) ;
40394067 static_assert_size ! ( Expr , 72 ) ;
40404068 static_assert_size ! ( ExprKind , 40 ) ;
4041- static_assert_size ! ( Fn , 184 ) ;
4069+ static_assert_size ! ( Fn , 192 ) ;
40424070 static_assert_size ! ( ForeignItem , 80 ) ;
40434071 static_assert_size ! ( ForeignItemKind , 16 ) ;
40444072 static_assert_size ! ( GenericArg , 24 ) ;
0 commit comments