Skip to content

Commit 1ae3c36

Browse files
committed
Rename hair::FieldPattern to hair::FieldPat
1 parent 3812117 commit 1ae3c36

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/librustc_mir/build/matches/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
739739
match_pair_index: usize,
740740
adt_def: &'tcx ty::AdtDef,
741741
variant_index: VariantIdx,
742-
subpatterns: &'pat [FieldPattern<'tcx>],
742+
subpatterns: &'pat [FieldPat<'tcx>],
743743
candidate: &mut Candidate<'pat, 'tcx>,
744744
) {
745745
let match_pair = candidate.match_pairs.remove(match_pair_index);

src/librustc_mir/build/matches/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::convert::TryInto;
88
impl<'a, 'tcx> Builder<'a, 'tcx> {
99
pub fn field_match_pairs<'pat>(&mut self,
1010
place: Place<'tcx>,
11-
subpatterns: &'pat [FieldPattern<'tcx>])
11+
subpatterns: &'pat [FieldPat<'tcx>])
1212
-> Vec<MatchPair<'pat, 'tcx>> {
1313
subpatterns.iter()
1414
.map(|fieldpat| {

src/librustc_mir/hair/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub mod cx;
2020
mod constant;
2121

2222
pub mod pattern;
23-
pub use self::pattern::{BindingMode, Pattern, PatternKind, PatternRange, FieldPattern};
23+
pub use self::pattern::{BindingMode, Pattern, PatternKind, PatternRange, FieldPat};
2424
pub(crate) use self::pattern::PatternTypeProjection;
2525

2626
mod util;

src/librustc_mir/hair/pattern/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ use self::WitnessPreference::*;
163163
use rustc_data_structures::fx::FxHashMap;
164164
use rustc_data_structures::indexed_vec::Idx;
165165

166-
use super::{FieldPattern, Pattern, PatternKind, PatternRange};
166+
use super::{FieldPat, Pattern, PatternKind, PatternRange};
167167
use super::{PatternFoldable, PatternFolder, compare_const_vals};
168168

169169
use rustc::hir::def_id::DefId;
@@ -569,7 +569,7 @@ impl<'tcx> Witness<'tcx> {
569569
ty::Adt(..) |
570570
ty::Tuple(..) => {
571571
let pats = pats.enumerate().map(|(i, p)| {
572-
FieldPattern {
572+
FieldPat {
573573
field: Field::new(i),
574574
pattern: p
575575
}
@@ -1714,7 +1714,7 @@ fn constructor_covered_by_range<'tcx>(
17141714
}
17151715

17161716
fn patterns_for_variant<'p, 'tcx>(
1717-
subpatterns: &'p [FieldPattern<'tcx>],
1717+
subpatterns: &'p [FieldPat<'tcx>],
17181718
wild_patterns: &[&'p Pattern<'tcx>])
17191719
-> SmallVec<[&'p Pattern<'tcx>; 2]>
17201720
{

src/librustc_mir/hair/pattern/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub enum BindingMode {
4848
}
4949

5050
#[derive(Clone, Debug)]
51-
pub struct FieldPattern<'tcx> {
51+
pub struct FieldPat<'tcx> {
5252
pub field: Field,
5353
pub pattern: Pattern<'tcx>,
5454
}
@@ -140,13 +140,13 @@ pub enum PatternKind<'tcx> {
140140
adt_def: &'tcx AdtDef,
141141
substs: SubstsRef<'tcx>,
142142
variant_index: VariantIdx,
143-
subpatterns: Vec<FieldPattern<'tcx>>,
143+
subpatterns: Vec<FieldPat<'tcx>>,
144144
},
145145

146146
/// `(...)`, `Foo(...)`, `Foo{...}`, or `Foo`, where `Foo` is a variant name from an ADT with
147147
/// a single variant.
148148
Leaf {
149-
subpatterns: Vec<FieldPattern<'tcx>>,
149+
subpatterns: Vec<FieldPat<'tcx>>,
150150
},
151151

152152
/// `box P`, `&P`, `&mut P`, etc.
@@ -578,7 +578,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
578578
let subpatterns =
579579
subpatterns.iter()
580580
.enumerate_and_adjust(tys.len(), ddpos)
581-
.map(|(i, subpattern)| FieldPattern {
581+
.map(|(i, subpattern)| FieldPat {
582582
field: Field::new(i),
583583
pattern: self.lower_pattern(subpattern)
584584
})
@@ -650,7 +650,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
650650
let subpatterns =
651651
subpatterns.iter()
652652
.enumerate_and_adjust(variant_def.fields.len(), ddpos)
653-
.map(|(i, field)| FieldPattern {
653+
.map(|(i, field)| FieldPat {
654654
field: Field::new(i),
655655
pattern: self.lower_pattern(field),
656656
})
@@ -664,7 +664,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
664664
let subpatterns =
665665
fields.iter()
666666
.map(|field| {
667-
FieldPattern {
667+
FieldPat {
668668
field: Field::new(self.tcx.field_index(field.hir_id,
669669
self.tables)),
670670
pattern: self.lower_pattern(&field.pat),
@@ -772,7 +772,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
772772
hir_id: hir::HirId,
773773
span: Span,
774774
ty: Ty<'tcx>,
775-
subpatterns: Vec<FieldPattern<'tcx>>,
775+
subpatterns: Vec<FieldPat<'tcx>>,
776776
) -> PatternKind<'tcx> {
777777
let res = match res {
778778
Res::Def(DefKind::Ctor(CtorOf::Variant, ..), variant_ctor_id) => {
@@ -1069,7 +1069,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
10691069
let mut adt_subpatterns = |n, variant_opt| {
10701070
(0..n).map(|i| {
10711071
let field = Field::new(i);
1072-
FieldPattern {
1072+
FieldPat {
10731073
field,
10741074
pattern: adt_subpattern(i, variant_opt),
10751075
}
@@ -1361,9 +1361,9 @@ CloneImpls!{ <'tcx>
13611361
UserTypeProjection, PatternTypeProjection<'tcx>
13621362
}
13631363

1364-
impl<'tcx> PatternFoldable<'tcx> for FieldPattern<'tcx> {
1364+
impl<'tcx> PatternFoldable<'tcx> for FieldPat<'tcx> {
13651365
fn super_fold_with<F: PatternFolder<'tcx>>(&self, folder: &mut F) -> Self {
1366-
FieldPattern {
1366+
FieldPat {
13671367
field: self.field.fold_with(folder),
13681368
pattern: self.pattern.fold_with(folder)
13691369
}

0 commit comments

Comments
 (0)