mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 17:12:53 +00:00
Shrink some visibilities.
This commit is contained in:
parent
af128b0144
commit
f3a37ed574
@ -66,11 +66,11 @@ struct Cx<'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
thir: Thir<'tcx>,
|
||||
|
||||
pub(crate) param_env: ty::ParamEnv<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
|
||||
pub(crate) region_scope_tree: &'tcx region::ScopeTree,
|
||||
pub(crate) typeck_results: &'tcx ty::TypeckResults<'tcx>,
|
||||
pub(crate) rvalue_scopes: &'tcx RvalueScopes,
|
||||
region_scope_tree: &'tcx region::ScopeTree,
|
||||
typeck_results: &'tcx ty::TypeckResults<'tcx>,
|
||||
rvalue_scopes: &'tcx RvalueScopes,
|
||||
|
||||
/// When applying adjustments to the expression
|
||||
/// with the given `HirId`, use the given `Span`,
|
||||
@ -100,7 +100,7 @@ impl<'tcx> Cx<'tcx> {
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(crate) fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Box<Pat<'tcx>> {
|
||||
fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Box<Pat<'tcx>> {
|
||||
let p = match self.tcx.hir().get(p.hir_id) {
|
||||
Node::Pat(p) => p,
|
||||
node => bug!("pattern became {:?}", node),
|
||||
|
@ -29,22 +29,22 @@ use rustc_span::{Span, Symbol};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) enum PatternError {
|
||||
enum PatternError {
|
||||
AssocConstInPattern(Span),
|
||||
ConstParamInPattern(Span),
|
||||
StaticInPattern(Span),
|
||||
NonConstPath(Span),
|
||||
}
|
||||
|
||||
pub(crate) struct PatCtxt<'a, 'tcx> {
|
||||
pub(crate) tcx: TyCtxt<'tcx>,
|
||||
pub(crate) param_env: ty::ParamEnv<'tcx>,
|
||||
pub(crate) typeck_results: &'a ty::TypeckResults<'tcx>,
|
||||
pub(crate) errors: Vec<PatternError>,
|
||||
struct PatCtxt<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
typeck_results: &'a ty::TypeckResults<'tcx>,
|
||||
errors: Vec<PatternError>,
|
||||
include_lint_checks: bool,
|
||||
}
|
||||
|
||||
pub(crate) fn pat_from_hir<'a, 'tcx>(
|
||||
pub(super) fn pat_from_hir<'a, 'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
typeck_results: &'a ty::TypeckResults<'tcx>,
|
||||
@ -61,7 +61,7 @@ pub(crate) fn pat_from_hir<'a, 'tcx>(
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
||||
pub(crate) fn new(
|
||||
fn new(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
typeck_results: &'a ty::TypeckResults<'tcx>,
|
||||
@ -69,12 +69,12 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
||||
PatCtxt { tcx, param_env, typeck_results, errors: vec![], include_lint_checks: false }
|
||||
}
|
||||
|
||||
pub(crate) fn include_lint_checks(&mut self) -> &mut Self {
|
||||
fn include_lint_checks(&mut self) -> &mut Self {
|
||||
self.include_lint_checks = true;
|
||||
self
|
||||
}
|
||||
|
||||
pub(crate) fn lower_pattern(&mut self, pat: &'tcx hir::Pat<'tcx>) -> Box<Pat<'tcx>> {
|
||||
fn lower_pattern(&mut self, pat: &'tcx hir::Pat<'tcx>) -> Box<Pat<'tcx>> {
|
||||
// When implicit dereferences have been inserted in this pattern, the unadjusted lowered
|
||||
// pattern has the type that results *after* dereferencing. For example, in this code:
|
||||
//
|
||||
@ -627,7 +627,7 @@ impl<'tcx> UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) trait PatternFoldable<'tcx>: Sized {
|
||||
trait PatternFoldable<'tcx>: Sized {
|
||||
fn fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self {
|
||||
self.super_fold_with(folder)
|
||||
}
|
||||
@ -635,7 +635,7 @@ pub(crate) trait PatternFoldable<'tcx>: Sized {
|
||||
fn super_fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self;
|
||||
}
|
||||
|
||||
pub(crate) trait PatternFolder<'tcx>: Sized {
|
||||
trait PatternFolder<'tcx>: Sized {
|
||||
fn fold_pattern(&mut self, pattern: &Pat<'tcx>) -> Pat<'tcx> {
|
||||
pattern.super_fold_with(self)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user