@@ -165,13 +165,6 @@ struct EmbargoVisitor<'a, 'tcx: 'a> {
165
165
// may jump across private boundaries through reexport statements or type aliases.
166
166
exported_items : ExportedItems ,
167
167
168
- // This sets contains all the destination nodes which are publicly
169
- // re-exported. This is *not* a set of all reexported nodes, only a set of
170
- // all nodes which are reexported *and* reachable from external crates. This
171
- // means that the destination of the reexport is exported, and hence the
172
- // destination must also be exported.
173
- reexports : NodeSet ,
174
-
175
168
// Items that are directly public without help of reexports or type aliases.
176
169
// These two fields are closely related to one another in that they are only
177
170
// used for generation of the `public_items` set, not for privacy checking at
@@ -237,7 +230,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
237
230
_ => {
238
231
self . prev_public = self . prev_public && item. vis == hir:: Public ;
239
232
self . prev_exported = ( self . prev_exported && item. vis == hir:: Public ) ||
240
- self . reexports . contains ( & item. id ) ;
233
+ self . exported_items . contains ( & item. id ) ;
241
234
242
235
self . maybe_insert_id ( item. id ) ;
243
236
}
@@ -347,7 +340,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
347
340
for foreign_item in & foreign_mod. items {
348
341
let public = self . prev_public && foreign_item. vis == hir:: Public ;
349
342
let exported = ( self . prev_exported && foreign_item. vis == hir:: Public ) ||
350
- self . reexports . contains ( & foreign_item. id ) ;
343
+ self . exported_items . contains ( & foreign_item. id ) ;
351
344
352
345
if public {
353
346
self . public_items . insert ( foreign_item. id ) ;
@@ -387,7 +380,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
387
380
assert ! ( self . export_map. contains_key( & id) , "wut {}" , id) ;
388
381
for export in self . export_map . get ( & id) . unwrap ( ) {
389
382
if let Some ( node_id) = self . tcx . map . as_local_node_id ( export. def_id ) {
390
- self . reexports . insert ( node_id) ;
383
+ self . exported_items . insert ( node_id) ;
391
384
}
392
385
}
393
386
}
@@ -1532,17 +1525,14 @@ pub fn check_crate(tcx: &ty::ctxt,
1532
1525
tcx : tcx,
1533
1526
exported_items : NodeSet ( ) ,
1534
1527
public_items : NodeSet ( ) ,
1535
- reexports : NodeSet ( ) ,
1536
1528
export_map : export_map,
1537
1529
prev_exported : true ,
1538
1530
prev_public : true ,
1539
1531
} ;
1540
1532
loop {
1541
- let before = ( visitor. exported_items . len ( ) , visitor. public_items . len ( ) ,
1542
- visitor. reexports . len ( ) ) ;
1533
+ let before = ( visitor. exported_items . len ( ) , visitor. public_items . len ( ) ) ;
1543
1534
visit:: walk_crate ( & mut visitor, krate) ;
1544
- let after = ( visitor. exported_items . len ( ) , visitor. public_items . len ( ) ,
1545
- visitor. reexports . len ( ) ) ;
1535
+ let after = ( visitor. exported_items . len ( ) , visitor. public_items . len ( ) ) ;
1546
1536
if after == before {
1547
1537
break
1548
1538
}
0 commit comments