@@ -1245,6 +1245,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
12451245 impl_items,
12461246 foreign_items,
12471247 body_owners,
1248+ opaques,
12481249 ..
12491250 } = collector;
12501251 return ModuleItems {
@@ -1254,6 +1255,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
12541255 impl_items : impl_items. into_boxed_slice ( ) ,
12551256 foreign_items : foreign_items. into_boxed_slice ( ) ,
12561257 body_owners : body_owners. into_boxed_slice ( ) ,
1258+ opaques : opaques. into_boxed_slice ( ) ,
12571259 } ;
12581260}
12591261
@@ -1273,6 +1275,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
12731275 impl_items,
12741276 foreign_items,
12751277 body_owners,
1278+ opaques,
12761279 ..
12771280 } = collector;
12781281
@@ -1283,6 +1286,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
12831286 impl_items : impl_items. into_boxed_slice ( ) ,
12841287 foreign_items : foreign_items. into_boxed_slice ( ) ,
12851288 body_owners : body_owners. into_boxed_slice ( ) ,
1289+ opaques : opaques. into_boxed_slice ( ) ,
12861290 } ;
12871291}
12881292
@@ -1297,6 +1301,7 @@ struct ItemCollector<'tcx> {
12971301 impl_items : Vec < ImplItemId > ,
12981302 foreign_items : Vec < ForeignItemId > ,
12991303 body_owners : Vec < LocalDefId > ,
1304+ opaques : Vec < LocalDefId > ,
13001305}
13011306
13021307impl < ' tcx > ItemCollector < ' tcx > {
@@ -1310,6 +1315,7 @@ impl<'tcx> ItemCollector<'tcx> {
13101315 impl_items : Vec :: default ( ) ,
13111316 foreign_items : Vec :: default ( ) ,
13121317 body_owners : Vec :: default ( ) ,
1318+ opaques : Vec :: default ( ) ,
13131319 }
13141320 }
13151321}
@@ -1355,6 +1361,11 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
13551361 intravisit:: walk_inline_const ( self , c)
13561362 }
13571363
1364+ fn visit_opaque_ty ( & mut self , o : & ' hir OpaqueTy < ' hir > ) {
1365+ self . opaques . push ( o. def_id ) ;
1366+ intravisit:: walk_opaque_ty ( self , o)
1367+ }
1368+
13581369 fn visit_expr ( & mut self , ex : & ' hir Expr < ' hir > ) {
13591370 if let ExprKind :: Closure ( closure) = ex. kind {
13601371 self . body_owners . push ( closure. def_id ) ;
0 commit comments