@@ -2066,6 +2066,19 @@ pub struct MacroDef {
2066
2066
pub body : Box < DelimArgs > ,
2067
2067
/// `true` if macro was defined with `macro_rules`.
2068
2068
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 ,
2069
2082
}
2070
2083
2071
2084
#[ derive( Clone , Encodable , Decodable , Debug , Copy , Hash , Eq , PartialEq ) ]
@@ -3691,6 +3704,21 @@ pub struct Fn {
3691
3704
pub contract : Option < Box < FnContract > > ,
3692
3705
pub define_opaque : Option < ThinVec < ( NodeId , Path ) > > ,
3693
3706
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 ,
3694
3722
}
3695
3723
3696
3724
#[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
@@ -4038,7 +4066,7 @@ mod size_asserts {
4038
4066
static_assert_size ! ( Block , 32 ) ;
4039
4067
static_assert_size ! ( Expr , 72 ) ;
4040
4068
static_assert_size ! ( ExprKind , 40 ) ;
4041
- static_assert_size ! ( Fn , 184 ) ;
4069
+ static_assert_size ! ( Fn , 192 ) ;
4042
4070
static_assert_size ! ( ForeignItem , 80 ) ;
4043
4071
static_assert_size ! ( ForeignItemKind , 16 ) ;
4044
4072
static_assert_size ! ( GenericArg , 24 ) ;
0 commit comments