Skip to content

Commit e504c10

Browse files
authored
Rollup merge of rust-lang#147016 - hkBst:whitespace-1, r=nnethercote
fix doc comments to be more standard
2 parents ba93a4f + fc703ec commit e504c10

File tree

2 files changed

+5
-23
lines changed
  • compiler

2 files changed

+5
-23
lines changed

compiler/rustc_mir_build/src/builder/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,10 @@ enum NeedsTemporary {
395395
Maybe,
396396
}
397397

398-
///////////////////////////////////////////////////////////////////////////
399398
/// The `BlockAnd` "monad" packages up the new basic block along with a
400399
/// produced value (sometimes just unit, of course). The `unpack!`
401400
/// macro (and methods below) makes working with `BlockAnd` much more
402401
/// convenient.
403-
404402
#[must_use = "if you don't use one of these results, you're leaving a dangling edge"]
405403
struct BlockAnd<T>(BasicBlock, T);
406404

@@ -438,9 +436,7 @@ macro_rules! unpack {
438436
}};
439437
}
440438

441-
///////////////////////////////////////////////////////////////////////////
442-
/// the main entry point for building MIR for a function
443-
439+
/// The main entry point for building MIR for a function.
444440
fn construct_fn<'tcx>(
445441
tcx: TyCtxt<'tcx>,
446442
fn_def: LocalDefId,

compiler/rustc_privacy/src/lib.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use tracing::debug;
4545
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
4646

4747
////////////////////////////////////////////////////////////////////////////////
48-
/// Generic infrastructure used to implement specific visitors below.
48+
// Generic infrastructure used to implement specific visitors below.
4949
////////////////////////////////////////////////////////////////////////////////
5050

5151
struct LazyDefPathStr<'tcx> {
@@ -309,10 +309,7 @@ fn min(vis1: ty::Visibility, vis2: ty::Visibility, tcx: TyCtxt<'_>) -> ty::Visib
309309
if vis1.is_at_least(vis2, tcx) { vis2 } else { vis1 }
310310
}
311311

312-
////////////////////////////////////////////////////////////////////////////////
313312
/// Visitor used to determine impl visibility and reachability.
314-
////////////////////////////////////////////////////////////////////////////////
315-
316313
struct FindMin<'a, 'tcx, VL: VisibilityLike, const SHALLOW: bool> {
317314
tcx: TyCtxt<'tcx>,
318315
effective_visibilities: &'a EffectiveVisibilities,
@@ -387,10 +384,7 @@ impl VisibilityLike for EffectiveVisibility {
387384
}
388385
}
389386

390-
////////////////////////////////////////////////////////////////////////////////
391387
/// The embargo visitor, used to determine the exports of the AST.
392-
////////////////////////////////////////////////////////////////////////////////
393-
394388
struct EmbargoVisitor<'tcx> {
395389
tcx: TyCtxt<'tcx>,
396390

@@ -849,9 +843,7 @@ impl<'tcx> DefIdVisitor<'tcx> for ReachEverythingInTheInterfaceVisitor<'_, 'tcx>
849843
}
850844
}
851845

852-
////////////////////////////////////////////////////////////////////////////////
853846
/// Visitor, used for EffectiveVisibilities table checking
854-
////////////////////////////////////////////////////////////////////////////////
855847
pub struct TestReachabilityVisitor<'a, 'tcx> {
856848
tcx: TyCtxt<'tcx>,
857849
effective_visibilities: &'a EffectiveVisibilities,
@@ -909,13 +901,11 @@ impl<'a, 'tcx> TestReachabilityVisitor<'a, 'tcx> {
909901
}
910902
}
911903

912-
//////////////////////////////////////////////////////////////////////////////////////
913904
/// Name privacy visitor, checks privacy and reports violations.
905+
///
914906
/// Most of name privacy checks are performed during the main resolution phase,
915907
/// or later in type checking when field accesses and associated items are resolved.
916908
/// This pass performs remaining checks for fields in struct expressions and patterns.
917-
//////////////////////////////////////////////////////////////////////////////////////
918-
919909
struct NamePrivacyVisitor<'tcx> {
920910
tcx: TyCtxt<'tcx>,
921911
maybe_typeck_results: Option<&'tcx ty::TypeckResults<'tcx>>,
@@ -1120,12 +1110,10 @@ impl<'tcx> Visitor<'tcx> for NamePrivacyVisitor<'tcx> {
11201110
}
11211111
}
11221112

1123-
////////////////////////////////////////////////////////////////////////////////////////////
11241113
/// Type privacy visitor, checks types for privacy and reports violations.
1114+
///
11251115
/// Both explicitly written types and inferred types of expressions and patterns are checked.
11261116
/// Checks are performed on "semantic" types regardless of names and their hygiene.
1127-
////////////////////////////////////////////////////////////////////////////////////////////
1128-
11291117
struct TypePrivacyVisitor<'tcx> {
11301118
tcx: TyCtxt<'tcx>,
11311119
module_def_id: LocalModDefId,
@@ -1345,13 +1333,11 @@ impl<'tcx> DefIdVisitor<'tcx> for TypePrivacyVisitor<'tcx> {
13451333
}
13461334
}
13471335

1348-
///////////////////////////////////////////////////////////////////////////////
13491336
/// SearchInterfaceForPrivateItemsVisitor traverses an item's interface and
13501337
/// finds any private components in it.
1338+
///
13511339
/// PrivateItemsInPublicInterfacesVisitor ensures there are no private types
13521340
/// and traits in public interfaces.
1353-
///////////////////////////////////////////////////////////////////////////////
1354-
13551341
struct SearchInterfaceForPrivateItemsVisitor<'tcx> {
13561342
tcx: TyCtxt<'tcx>,
13571343
item_def_id: LocalDefId,

0 commit comments

Comments
 (0)