Skip to content

Commit d556193

Browse files
committed
Rename PatternContext to PatCtxt
1 parent 5fbc211 commit d556193

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/librustc_mir/hair/pattern/_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ pub enum WitnessPreference {
476476
}
477477

478478
#[derive(Copy, Clone, Debug)]
479-
struct PatternContext<'tcx> {
479+
struct PatCtxt<'tcx> {
480480
ty: Ty<'tcx>,
481481
max_slice_length: u64,
482482
}
@@ -636,7 +636,7 @@ impl<'tcx> Witness<'tcx> {
636636
/// `Option<!>`, we do not include `Some(_)` in the returned list of constructors.
637637
fn all_constructors<'a, 'tcx>(
638638
cx: &mut MatchCheckCtxt<'a, 'tcx>,
639-
pcx: PatternContext<'tcx>,
639+
pcx: PatCtxt<'tcx>,
640640
) -> Vec<Constructor<'tcx>> {
641641
debug!("all_constructors({:?})", pcx.ty);
642642
let ctors = match pcx.ty.kind {
@@ -1094,7 +1094,7 @@ pub fn is_useful<'p, 'a, 'tcx>(
10941094

10951095
assert!(rows.iter().all(|r| r.len() == v.len()));
10961096

1097-
let pcx = PatternContext {
1097+
let pcx = PatCtxt {
10981098
// TyErr is used to represent the type of wildcard patterns matching
10991099
// against inaccessible (private) fields of structs, so that we won't
11001100
// be able to observe whether the types of the struct's fields are
@@ -1326,7 +1326,7 @@ fn is_useful_specialized<'p, 'a, 'tcx>(
13261326
/// Returns `None` in case of a catch-all, which can't be specialized.
13271327
fn pat_constructors<'tcx>(cx: &mut MatchCheckCtxt<'_, 'tcx>,
13281328
pat: &Pattern<'tcx>,
1329-
pcx: PatternContext<'tcx>)
1329+
pcx: PatCtxt<'tcx>)
13301330
-> Option<Vec<Constructor<'tcx>>>
13311331
{
13321332
match *pat.kind {

src/librustc_mir/hair/pattern/check_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::_match::{MatchCheckCtxt, Matrix, expand_pattern, is_useful};
22
use super::_match::Usefulness::*;
33
use super::_match::WitnessPreference::*;
44

5-
use super::{Pattern, PatternContext, PatternError, PatKind};
5+
use super::{Pattern, PatCtxt, PatternError, PatKind};
66

77
use rustc::middle::borrowck::SignalledError;
88
use rustc::session::Session;
@@ -88,7 +88,7 @@ impl<'tcx> Visitor<'tcx> for MatchVisitor<'_, 'tcx> {
8888
}
8989
}
9090

91-
impl PatternContext<'_, '_> {
91+
impl PatCtxt<'_, '_> {
9292
fn report_inlining_errors(&self, pat_span: Span) {
9393
for error in &self.errors {
9494
match *error {
@@ -152,7 +152,7 @@ impl<'tcx> MatchVisitor<'_, 'tcx> {
152152

153153
let inlined_arms : Vec<(Vec<_>, _)> = arms.iter().map(|arm| (
154154
arm.top_pats_hack().iter().map(|pat| {
155-
let mut patcx = PatternContext::new(self.tcx,
155+
let mut patcx = PatCtxt::new(self.tcx,
156156
self.param_env.and(self.identity_substs),
157157
self.tables);
158158
patcx.include_lint_checks();
@@ -249,7 +249,7 @@ impl<'tcx> MatchVisitor<'_, 'tcx> {
249249
fn check_irrefutable(&self, pat: &'tcx Pat, origin: &str) {
250250
let module = self.tcx.hir().get_module_parent(pat.hir_id);
251251
MatchCheckCtxt::create_and_enter(self.tcx, self.param_env, module, |ref mut cx| {
252-
let mut patcx = PatternContext::new(self.tcx,
252+
let mut patcx = PatCtxt::new(self.tcx,
253253
self.param_env.and(self.identity_substs),
254254
self.tables);
255255
patcx.include_lint_checks();

src/librustc_mir/hair/pattern/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'tcx> fmt::Display for Pattern<'tcx> {
347347
}
348348
}
349349

350-
pub struct PatternContext<'a, 'tcx> {
350+
pub struct PatCtxt<'a, 'tcx> {
351351
pub tcx: TyCtxt<'tcx>,
352352
pub param_env: ty::ParamEnv<'tcx>,
353353
pub tables: &'a ty::TypeckTables<'tcx>,
@@ -363,7 +363,7 @@ impl<'a, 'tcx> Pattern<'tcx> {
363363
tables: &'a ty::TypeckTables<'tcx>,
364364
pat: &'tcx hir::Pat,
365365
) -> Self {
366-
let mut pcx = PatternContext::new(tcx, param_env_and_substs, tables);
366+
let mut pcx = PatCtxt::new(tcx, param_env_and_substs, tables);
367367
let result = pcx.lower_pattern(pat);
368368
if !pcx.errors.is_empty() {
369369
let msg = format!("encountered errors lowering pattern: {:?}", pcx.errors);
@@ -374,13 +374,13 @@ impl<'a, 'tcx> Pattern<'tcx> {
374374
}
375375
}
376376

377-
impl<'a, 'tcx> PatternContext<'a, 'tcx> {
377+
impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
378378
pub fn new(
379379
tcx: TyCtxt<'tcx>,
380380
param_env_and_substs: ty::ParamEnvAnd<'tcx, SubstsRef<'tcx>>,
381381
tables: &'a ty::TypeckTables<'tcx>,
382382
) -> Self {
383-
PatternContext {
383+
PatCtxt {
384384
tcx,
385385
param_env: param_env_and_substs.param_env,
386386
tables,
@@ -1293,7 +1293,7 @@ fn search_for_adt_without_structural_match<'tcx>(tcx: TyCtxt<'tcx>,
12931293
}
12941294
}
12951295

1296-
impl UserAnnotatedTyHelpers<'tcx> for PatternContext<'_, 'tcx> {
1296+
impl UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx> {
12971297
fn tcx(&self) -> TyCtxt<'tcx> {
12981298
self.tcx
12991299
}

0 commit comments

Comments
 (0)