@@ -1245,6 +1245,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
1245
1245
impl_items,
1246
1246
foreign_items,
1247
1247
body_owners,
1248
+ opaques,
1248
1249
..
1249
1250
} = collector;
1250
1251
return ModuleItems {
@@ -1254,6 +1255,7 @@ pub(super) fn hir_module_items(tcx: TyCtxt<'_>, module_id: LocalModDefId) -> Mod
1254
1255
impl_items : impl_items. into_boxed_slice ( ) ,
1255
1256
foreign_items : foreign_items. into_boxed_slice ( ) ,
1256
1257
body_owners : body_owners. into_boxed_slice ( ) ,
1258
+ opaques : opaques. into_boxed_slice ( ) ,
1257
1259
} ;
1258
1260
}
1259
1261
@@ -1273,6 +1275,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
1273
1275
impl_items,
1274
1276
foreign_items,
1275
1277
body_owners,
1278
+ opaques,
1276
1279
..
1277
1280
} = collector;
1278
1281
@@ -1283,6 +1286,7 @@ pub(crate) fn hir_crate_items(tcx: TyCtxt<'_>, _: ()) -> ModuleItems {
1283
1286
impl_items : impl_items. into_boxed_slice ( ) ,
1284
1287
foreign_items : foreign_items. into_boxed_slice ( ) ,
1285
1288
body_owners : body_owners. into_boxed_slice ( ) ,
1289
+ opaques : opaques. into_boxed_slice ( ) ,
1286
1290
} ;
1287
1291
}
1288
1292
@@ -1297,6 +1301,7 @@ struct ItemCollector<'tcx> {
1297
1301
impl_items : Vec < ImplItemId > ,
1298
1302
foreign_items : Vec < ForeignItemId > ,
1299
1303
body_owners : Vec < LocalDefId > ,
1304
+ opaques : Vec < LocalDefId > ,
1300
1305
}
1301
1306
1302
1307
impl < ' tcx > ItemCollector < ' tcx > {
@@ -1310,6 +1315,7 @@ impl<'tcx> ItemCollector<'tcx> {
1310
1315
impl_items : Vec :: default ( ) ,
1311
1316
foreign_items : Vec :: default ( ) ,
1312
1317
body_owners : Vec :: default ( ) ,
1318
+ opaques : Vec :: default ( ) ,
1313
1319
}
1314
1320
}
1315
1321
}
@@ -1355,6 +1361,11 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> {
1355
1361
intravisit:: walk_inline_const ( self , c)
1356
1362
}
1357
1363
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
+
1358
1369
fn visit_expr ( & mut self , ex : & ' hir Expr < ' hir > ) {
1359
1370
if let ExprKind :: Closure ( closure) = ex. kind {
1360
1371
self . body_owners . push ( closure. def_id ) ;
0 commit comments