@@ -175,9 +175,7 @@ struct EmbargoVisitor<'a, 'tcx: 'a> {
175
175
// Items that are directly public without help of reexports or type aliases.
176
176
// These two fields are closely related to one another in that they are only
177
177
// used for generation of the `public_items` set, not for privacy checking at
178
- // all. Public items are mostly a subset of exported items with exception of
179
- // fields and exported macros - they are public, but not exported.
180
- // FIXME: Make fields and exported macros exported as well (requires fixing resulting ICEs)
178
+ // all. Invariant: at any moment public items are a subset of exported items.
181
179
public_items : PublicItems ,
182
180
prev_public : bool ,
183
181
}
@@ -251,11 +249,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
251
249
self . maybe_insert_id ( variant. node . data . id ( ) ) ;
252
250
for field in variant. node . data . fields ( ) {
253
251
// Variant fields are always public
254
- if self . prev_public {
255
- self . public_items . insert ( field. node . id ) ;
256
- }
257
- // FIXME: Make fields exported (requires fixing resulting ICEs)
258
- // if self.prev_exported { self.exported_items.insert(field.node.id); }
252
+ self . maybe_insert_id ( field. node . id ) ;
259
253
}
260
254
}
261
255
}
@@ -328,11 +322,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
328
322
for field in def. fields ( ) {
329
323
// Struct fields can be public or private, so lets check
330
324
if field. node . kind . visibility ( ) == hir:: Public {
331
- if self . prev_public {
332
- self . public_items . insert ( field. node . id ) ;
333
- }
334
- // FIXME: Make fields exported (requires fixing resulting ICEs)
335
- // if self.prev_exported { self.exported_items.insert(field.node.id); }
325
+ self . maybe_insert_id ( field. node . id ) ;
336
326
}
337
327
}
338
328
}
@@ -403,9 +393,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
403
393
}
404
394
405
395
fn visit_macro_def ( & mut self , md : & ' v hir:: MacroDef ) {
406
- self . public_items . insert ( md. id ) ;
407
- // FIXME: Make exported macros exported (requires fixing resulting ICEs)
408
- // self.exported_items.insert(md.id);
396
+ self . maybe_insert_id ( md. id ) ;
409
397
}
410
398
}
411
399
0 commit comments