@@ -45,7 +45,7 @@ use tracing::debug;
45
45
rustc_fluent_macro:: fluent_messages! { "../messages.ftl" }
46
46
47
47
////////////////////////////////////////////////////////////////////////////////
48
- /// Generic infrastructure used to implement specific visitors below.
48
+ // Generic infrastructure used to implement specific visitors below.
49
49
////////////////////////////////////////////////////////////////////////////////
50
50
51
51
struct LazyDefPathStr < ' tcx > {
@@ -309,10 +309,7 @@ fn min(vis1: ty::Visibility, vis2: ty::Visibility, tcx: TyCtxt<'_>) -> ty::Visib
309
309
if vis1. is_at_least ( vis2, tcx) { vis2 } else { vis1 }
310
310
}
311
311
312
- ////////////////////////////////////////////////////////////////////////////////
313
312
/// Visitor used to determine impl visibility and reachability.
314
- ////////////////////////////////////////////////////////////////////////////////
315
-
316
313
struct FindMin < ' a , ' tcx , VL : VisibilityLike , const SHALLOW : bool > {
317
314
tcx : TyCtxt < ' tcx > ,
318
315
effective_visibilities : & ' a EffectiveVisibilities ,
@@ -387,10 +384,7 @@ impl VisibilityLike for EffectiveVisibility {
387
384
}
388
385
}
389
386
390
- ////////////////////////////////////////////////////////////////////////////////
391
387
/// The embargo visitor, used to determine the exports of the AST.
392
- ////////////////////////////////////////////////////////////////////////////////
393
-
394
388
struct EmbargoVisitor < ' tcx > {
395
389
tcx : TyCtxt < ' tcx > ,
396
390
@@ -849,9 +843,7 @@ impl<'tcx> DefIdVisitor<'tcx> for ReachEverythingInTheInterfaceVisitor<'_, 'tcx>
849
843
}
850
844
}
851
845
852
- ////////////////////////////////////////////////////////////////////////////////
853
846
/// Visitor, used for EffectiveVisibilities table checking
854
- ////////////////////////////////////////////////////////////////////////////////
855
847
pub struct TestReachabilityVisitor < ' a , ' tcx > {
856
848
tcx : TyCtxt < ' tcx > ,
857
849
effective_visibilities : & ' a EffectiveVisibilities ,
@@ -909,13 +901,11 @@ impl<'a, 'tcx> TestReachabilityVisitor<'a, 'tcx> {
909
901
}
910
902
}
911
903
912
- //////////////////////////////////////////////////////////////////////////////////////
913
904
/// Name privacy visitor, checks privacy and reports violations.
905
+ ///
914
906
/// Most of name privacy checks are performed during the main resolution phase,
915
907
/// or later in type checking when field accesses and associated items are resolved.
916
908
/// This pass performs remaining checks for fields in struct expressions and patterns.
917
- //////////////////////////////////////////////////////////////////////////////////////
918
-
919
909
struct NamePrivacyVisitor < ' tcx > {
920
910
tcx : TyCtxt < ' tcx > ,
921
911
maybe_typeck_results : Option < & ' tcx ty:: TypeckResults < ' tcx > > ,
@@ -1120,12 +1110,10 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
1120
1110
}
1121
1111
}
1122
1112
1123
- ////////////////////////////////////////////////////////////////////////////////////////////
1124
1113
/// Type privacy visitor, checks types for privacy and reports violations.
1114
+ ///
1125
1115
/// Both explicitly written types and inferred types of expressions and patterns are checked.
1126
1116
/// Checks are performed on "semantic" types regardless of names and their hygiene.
1127
- ////////////////////////////////////////////////////////////////////////////////////////////
1128
-
1129
1117
struct TypePrivacyVisitor < ' tcx > {
1130
1118
tcx : TyCtxt < ' tcx > ,
1131
1119
module_def_id : LocalModDefId ,
@@ -1345,13 +1333,11 @@ impl<'tcx> DefIdVisitor<'tcx> for TypePrivacyVisitor<'tcx> {
1345
1333
}
1346
1334
}
1347
1335
1348
- ///////////////////////////////////////////////////////////////////////////////
1349
1336
/// SearchInterfaceForPrivateItemsVisitor traverses an item's interface and
1350
1337
/// finds any private components in it.
1338
+ ///
1351
1339
/// PrivateItemsInPublicInterfacesVisitor ensures there are no private types
1352
1340
/// and traits in public interfaces.
1353
- ///////////////////////////////////////////////////////////////////////////////
1354
-
1355
1341
struct SearchInterfaceForPrivateItemsVisitor < ' tcx > {
1356
1342
tcx : TyCtxt < ' tcx > ,
1357
1343
item_def_id : LocalDefId ,
0 commit comments