Skip to content

Commit 8a594f0

Browse files
committed
Shrink some visibilities.
1 parent 692064b commit 8a594f0

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

compiler/rustc_mir_build/src/thir/cx/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ struct Cx<'tcx> {
6666
tcx: TyCtxt<'tcx>,
6767
thir: Thir<'tcx>,
6868

69-
pub(crate) param_env: ty::ParamEnv<'tcx>,
69+
param_env: ty::ParamEnv<'tcx>,
7070

71-
pub(crate) region_scope_tree: &'tcx region::ScopeTree,
72-
pub(crate) typeck_results: &'tcx ty::TypeckResults<'tcx>,
73-
pub(crate) rvalue_scopes: &'tcx RvalueScopes,
71+
region_scope_tree: &'tcx region::ScopeTree,
72+
typeck_results: &'tcx ty::TypeckResults<'tcx>,
73+
rvalue_scopes: &'tcx RvalueScopes,
7474

7575
/// When applying adjustments to the expression
7676
/// with the given `HirId`, use the given `Span`,
@@ -100,7 +100,7 @@ impl<'tcx> Cx<'tcx> {
100100
}
101101

102102
#[instrument(level = "debug", skip(self))]
103-
pub(crate) fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Pat<'tcx> {
103+
fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Pat<'tcx> {
104104
let p = match self.tcx.hir().get(p.hir_id) {
105105
Node::Pat(p) => p,
106106
node => bug!("pattern became {:?}", node),

compiler/rustc_mir_build/src/thir/pattern/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ use rustc_span::{Span, Symbol};
2929
use std::cmp::Ordering;
3030

3131
#[derive(Clone, Debug)]
32-
pub(crate) enum PatternError {
32+
enum PatternError {
3333
AssocConstInPattern(Span),
3434
ConstParamInPattern(Span),
3535
StaticInPattern(Span),
3636
NonConstPath(Span),
3737
}
3838

39-
pub(crate) struct PatCtxt<'a, 'tcx> {
40-
pub(crate) tcx: TyCtxt<'tcx>,
41-
pub(crate) param_env: ty::ParamEnv<'tcx>,
42-
pub(crate) typeck_results: &'a ty::TypeckResults<'tcx>,
43-
pub(crate) errors: Vec<PatternError>,
39+
struct PatCtxt<'a, 'tcx> {
40+
tcx: TyCtxt<'tcx>,
41+
param_env: ty::ParamEnv<'tcx>,
42+
typeck_results: &'a ty::TypeckResults<'tcx>,
43+
errors: Vec<PatternError>,
4444
include_lint_checks: bool,
4545
}
4646

47-
pub(crate) fn pat_from_hir<'a, 'tcx>(
47+
pub(super) fn pat_from_hir<'a, 'tcx>(
4848
tcx: TyCtxt<'tcx>,
4949
param_env: ty::ParamEnv<'tcx>,
5050
typeck_results: &'a ty::TypeckResults<'tcx>,
@@ -61,20 +61,20 @@ pub(crate) fn pat_from_hir<'a, 'tcx>(
6161
}
6262

6363
impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
64-
pub(crate) fn new(
64+
fn new(
6565
tcx: TyCtxt<'tcx>,
6666
param_env: ty::ParamEnv<'tcx>,
6767
typeck_results: &'a ty::TypeckResults<'tcx>,
6868
) -> Self {
6969
PatCtxt { tcx, param_env, typeck_results, errors: vec![], include_lint_checks: false }
7070
}
7171

72-
pub(crate) fn include_lint_checks(&mut self) -> &mut Self {
72+
fn include_lint_checks(&mut self) -> &mut Self {
7373
self.include_lint_checks = true;
7474
self
7575
}
7676

77-
pub(crate) fn lower_pattern(&mut self, pat: &'tcx hir::Pat<'tcx>) -> Pat<'tcx> {
77+
fn lower_pattern(&mut self, pat: &'tcx hir::Pat<'tcx>) -> Pat<'tcx> {
7878
// When implicit dereferences have been inserted in this pattern, the unadjusted lowered
7979
// pattern has the type that results *after* dereferencing. For example, in this code:
8080
//
@@ -615,15 +615,15 @@ impl<'tcx> UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx> {
615615
}
616616
}
617617

618-
pub(crate) trait PatternFoldable<'tcx>: Sized {
618+
trait PatternFoldable<'tcx>: Sized {
619619
fn fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self {
620620
self.super_fold_with(folder)
621621
}
622622

623623
fn super_fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self;
624624
}
625625

626-
pub(crate) trait PatternFolder<'tcx>: Sized {
626+
trait PatternFolder<'tcx>: Sized {
627627
fn fold_pattern(&mut self, pattern: &Pat<'tcx>) -> Pat<'tcx> {
628628
pattern.super_fold_with(self)
629629
}

0 commit comments

Comments
 (0)