@@ -2078,6 +2078,19 @@ pub struct MacroDef {
20782078 pub body : Box < DelimArgs > ,
20792079 /// `true` if macro was defined with `macro_rules`.
20802080 pub macro_rules : bool ,
2081+
2082+ /// If this is a macro used for externally implementable items,
2083+ /// it refers to an extern item which is its "target". This requires
2084+ /// name resolution so can't just be an attribute, so we store it in this field.
2085+ pub eii_extern_target : Option < EiiExternTarget > ,
2086+ }
2087+
2088+ #[ derive( Clone , Encodable , Decodable , Debug , HashStable_Generic , Walkable ) ]
2089+ pub struct EiiExternTarget {
2090+ /// path to the extern item we're targetting
2091+ pub extern_item_path : Path ,
2092+ pub impl_unsafe : bool ,
2093+ pub span : Span ,
20812094}
20822095
20832096#[ derive( Clone , Encodable , Decodable , Debug , Copy , Hash , Eq , PartialEq ) ]
@@ -3719,6 +3732,21 @@ pub struct Fn {
37193732 pub contract : Option < Box < FnContract > > ,
37203733 pub define_opaque : Option < ThinVec < ( NodeId , Path ) > > ,
37213734 pub body : Option < Box < Block > > ,
3735+
3736+ /// This function is an implementation of an externally implementable item (EII).
3737+ /// This means, there was an EII declared somewhere and this function is the
3738+ /// implementation that should be run when the declaration is called.
3739+ pub eii_impls : ThinVec < EiiImpl > ,
3740+ }
3741+
3742+ #[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
3743+ pub struct EiiImpl {
3744+ pub node_id : NodeId ,
3745+ pub eii_macro_path : Path ,
3746+ pub impl_safety : Safety ,
3747+ pub span : Span ,
3748+ pub inner_span : Span ,
3749+ pub is_default : bool ,
37223750}
37233751
37243752#[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
@@ -4066,7 +4094,7 @@ mod size_asserts {
40664094 static_assert_size ! ( Block , 32 ) ;
40674095 static_assert_size ! ( Expr , 72 ) ;
40684096 static_assert_size ! ( ExprKind , 40 ) ;
4069- static_assert_size ! ( Fn , 184 ) ;
4097+ static_assert_size ! ( Fn , 192 ) ;
40704098 static_assert_size ! ( ForeignItem , 80 ) ;
40714099 static_assert_size ! ( ForeignItemKind , 16 ) ;
40724100 static_assert_size ! ( GenericArg , 24 ) ;
0 commit comments