@@ -2065,6 +2065,19 @@ pub struct MacroDef {
2065
2065
pub body : Box < DelimArgs > ,
2066
2066
/// `true` if macro was defined with `macro_rules`.
2067
2067
pub macro_rules : bool ,
2068
+
2069
+ /// If this is a macro used for externally implementable items,
2070
+ /// it refers to an extern item which is its "target". This requires
2071
+ /// name resolution so can't just be an attribute, so we store it in this field.
2072
+ pub eii_extern_target : Option < EiiExternTarget > ,
2073
+ }
2074
+
2075
+ #[ derive( Clone , Encodable , Decodable , Debug , HashStable_Generic , Walkable ) ]
2076
+ pub struct EiiExternTarget {
2077
+ /// path to the extern item we're targetting
2078
+ pub extern_item_path : Path ,
2079
+ pub impl_unsafe : bool ,
2080
+ pub span : Span ,
2068
2081
}
2069
2082
2070
2083
#[ derive( Clone , Encodable , Decodable , Debug , Copy , Hash , Eq , PartialEq ) ]
@@ -3713,6 +3726,21 @@ pub struct Fn {
3713
3726
pub contract : Option < Box < FnContract > > ,
3714
3727
pub define_opaque : Option < ThinVec < ( NodeId , Path ) > > ,
3715
3728
pub body : Option < Box < Block > > ,
3729
+
3730
+ /// This function is an implementation of an externally implementable item (EII).
3731
+ /// This means, there was an EII declared somewhere and this function is the
3732
+ /// implementation that should be run when the declaration is called.
3733
+ pub eii_impls : ThinVec < EiiImpl > ,
3734
+ }
3735
+
3736
+ #[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
3737
+ pub struct EiiImpl {
3738
+ pub node_id : NodeId ,
3739
+ pub eii_macro_path : Path ,
3740
+ pub impl_safety : Safety ,
3741
+ pub span : Span ,
3742
+ pub inner_span : Span ,
3743
+ pub is_default : bool ,
3716
3744
}
3717
3745
3718
3746
#[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
@@ -4060,7 +4088,7 @@ mod size_asserts {
4060
4088
static_assert_size ! ( Block , 32 ) ;
4061
4089
static_assert_size ! ( Expr , 72 ) ;
4062
4090
static_assert_size ! ( ExprKind , 40 ) ;
4063
- static_assert_size ! ( Fn , 184 ) ;
4091
+ static_assert_size ! ( Fn , 192 ) ;
4064
4092
static_assert_size ! ( ForeignItem , 80 ) ;
4065
4093
static_assert_size ! ( ForeignItemKind , 16 ) ;
4066
4094
static_assert_size ! ( GenericArg , 24 ) ;
0 commit comments