@@ -394,6 +394,7 @@ pub struct Generics {
394394 pub params : ThinVec < GenericParam > ,
395395 pub where_clause : WhereClause ,
396396 pub span : Span ,
397+ pub define_opaques : Option < ThinVec < ( NodeId , Path ) > > ,
397398}
398399
399400/// A where-clause in a definition.
@@ -1413,6 +1414,7 @@ pub struct Closure {
14131414 pub fn_decl_span : Span ,
14141415 /// The span of the argument block `|...|`
14151416 pub fn_arg_span : Span ,
1417+ pub define_opaques : Option < ThinVec < ( NodeId , Path ) > > ,
14161418}
14171419
14181420/// Limit types of a range (inclusive or exclusive).
@@ -3233,6 +3235,30 @@ impl Item {
32333235 ItemKind :: Impl ( i) => Some ( & i. generics ) ,
32343236 }
32353237 }
3238+
3239+ pub fn define_opaques ( & mut self ) -> Option < & mut Option < ThinVec < ( NodeId , Path ) > > > {
3240+ match & mut self . kind {
3241+ ItemKind :: ExternCrate ( _)
3242+ | ItemKind :: Use ( _)
3243+ | ItemKind :: Mod ( _, _)
3244+ | ItemKind :: ForeignMod ( _)
3245+ | ItemKind :: GlobalAsm ( _)
3246+ | ItemKind :: MacCall ( _)
3247+ | ItemKind :: Delegation ( _)
3248+ | ItemKind :: DelegationMac ( _)
3249+ | ItemKind :: MacroDef ( _) => None ,
3250+ ItemKind :: Static ( s) => Some ( & mut s. define_opaques ) ,
3251+ ItemKind :: Const ( i) => Some ( & mut i. generics . define_opaques ) ,
3252+ ItemKind :: Fn ( i) => Some ( & mut i. generics . define_opaques ) ,
3253+ ItemKind :: TyAlias ( i) => Some ( & mut i. generics . define_opaques ) ,
3254+ ItemKind :: TraitAlias ( generics, _)
3255+ | ItemKind :: Enum ( _, generics)
3256+ | ItemKind :: Struct ( _, generics)
3257+ | ItemKind :: Union ( _, generics) => Some ( & mut generics. define_opaques ) ,
3258+ ItemKind :: Trait ( i) => Some ( & mut i. generics . define_opaques ) ,
3259+ ItemKind :: Impl ( i) => Some ( & mut i. generics . define_opaques ) ,
3260+ }
3261+ }
32363262}
32373263
32383264/// `extern` qualifier on a function item or function type.
@@ -3411,6 +3437,7 @@ pub struct StaticItem {
34113437 pub safety : Safety ,
34123438 pub mutability : Mutability ,
34133439 pub expr : Option < P < Expr > > ,
3440+ pub define_opaques : Option < ThinVec < ( NodeId , Path ) > > ,
34143441}
34153442
34163443#[ derive( Clone , Encodable , Decodable , Debug ) ]
@@ -3678,15 +3705,15 @@ mod size_asserts {
36783705 static_assert_size ! ( Block , 32 ) ;
36793706 static_assert_size ! ( Expr , 72 ) ;
36803707 static_assert_size ! ( ExprKind , 40 ) ;
3681- static_assert_size ! ( Fn , 168 ) ;
3708+ static_assert_size ! ( Fn , 176 ) ;
36823709 static_assert_size ! ( ForeignItem , 88 ) ;
36833710 static_assert_size ! ( ForeignItemKind , 16 ) ;
36843711 static_assert_size ! ( GenericArg , 24 ) ;
36853712 static_assert_size ! ( GenericBound , 88 ) ;
3686- static_assert_size ! ( Generics , 40 ) ;
3687- static_assert_size ! ( Impl , 136 ) ;
3688- static_assert_size ! ( Item , 136 ) ;
3689- static_assert_size ! ( ItemKind , 64 ) ;
3713+ static_assert_size ! ( Generics , 48 ) ;
3714+ static_assert_size ! ( Impl , 144 ) ;
3715+ static_assert_size ! ( Item , 144 ) ;
3716+ static_assert_size ! ( ItemKind , 72 ) ;
36903717 static_assert_size ! ( LitKind , 24 ) ;
36913718 static_assert_size ! ( Local , 80 ) ;
36923719 static_assert_size ! ( MetaItemLit , 40 ) ;
0 commit comments