Skip to content

Commit 5fbc211

Browse files
committed
Rename hair::PatternRange to hair::PatRange
1 parent ff59620 commit 5fbc211

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

src/librustc_mir/build/matches/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ enum TestKind<'tcx> {
760760
},
761761

762762
/// Test whether the value falls within an inclusive or exclusive range
763-
Range(PatternRange<'tcx>),
763+
Range(PatRange<'tcx>),
764764

765765
/// Test length of the slice is equal to len
766766
Len {

src/librustc_mir/build/matches/simplify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
108108
Err(match_pair)
109109
}
110110

111-
PatKind::Range(PatternRange { lo, hi, end }) => {
111+
PatKind::Range(PatRange { lo, hi, end }) => {
112112
let (range, bias) = match lo.ty.kind {
113113
ty::Char => {
114114
(Some(('\u{0000}' as u128, '\u{10FFFF}' as u128, Size::from_bits(32))), 0)

src/librustc_mir/build/matches/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
283283
}
284284
}
285285

286-
TestKind::Range(PatternRange { ref lo, ref hi, ref end }) => {
286+
TestKind::Range(PatRange { ref lo, ref hi, ref end }) => {
287287
let lower_bound_success = self.cfg.start_new_block();
288288
let target_blocks = make_target_blocks(self);
289289

@@ -771,7 +771,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
771771

772772
fn const_range_contains(
773773
&self,
774-
range: PatternRange<'tcx>,
774+
range: PatRange<'tcx>,
775775
value: &'tcx ty::Const<'tcx>,
776776
) -> Option<bool> {
777777
use std::cmp::Ordering::*;
@@ -790,7 +790,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
790790

791791
fn values_not_contained_in_range(
792792
&self,
793-
range: PatternRange<'tcx>,
793+
range: PatRange<'tcx>,
794794
indices: &FxHashMap<&'tcx ty::Const<'tcx>, usize>,
795795
) -> Option<bool> {
796796
for &val in indices.keys() {

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, PatKind, PatternRange, FieldPat};
23+
pub use self::pattern::{BindingMode, Pattern, PatKind, PatRange, FieldPat};
2424
pub(crate) use self::pattern::PatternTypeProjection;
2525

2626
mod util;

src/librustc_mir/hair/pattern/_match.rs

Lines changed: 5 additions & 5 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::{FieldPat, Pattern, PatKind, PatternRange};
166+
use super::{FieldPat, Pattern, PatKind, PatRange};
167167
use super::{PatternFoldable, PatternFolder, compare_const_vals};
168168

169169
use rustc::hir::def_id::DefId;
@@ -606,7 +606,7 @@ impl<'tcx> Witness<'tcx> {
606606
_ => {
607607
match *ctor {
608608
ConstantValue(value) => PatKind::Constant { value },
609-
ConstantRange(lo, hi, ty, end) => PatKind::Range(PatternRange {
609+
ConstantRange(lo, hi, ty, end) => PatKind::Range(PatRange {
610610
lo: ty::Const::from_bits(cx.tcx, lo, ty::ParamEnv::empty().and(ty)),
611611
hi: ty::Const::from_bits(cx.tcx, hi, ty::ParamEnv::empty().and(ty)),
612612
end,
@@ -879,7 +879,7 @@ impl<'tcx> IntRange<'tcx> {
879879
let range = loop {
880880
match pat.kind {
881881
box PatKind::Constant { value } => break ConstantValue(value),
882-
box PatKind::Range(PatternRange { lo, hi, end }) => break ConstantRange(
882+
box PatKind::Range(PatRange { lo, hi, end }) => break ConstantRange(
883883
lo.eval_bits(tcx, param_env, lo.ty),
884884
hi.eval_bits(tcx, param_env, hi.ty),
885885
lo.ty,
@@ -1338,7 +1338,7 @@ fn pat_constructors<'tcx>(cx: &mut MatchCheckCtxt<'_, 'tcx>,
13381338
Some(vec![Variant(adt_def.variants[variant_index].def_id)])
13391339
}
13401340
PatKind::Constant { value } => Some(vec![ConstantValue(value)]),
1341-
PatKind::Range(PatternRange { lo, hi, end }) =>
1341+
PatKind::Range(PatRange { lo, hi, end }) =>
13421342
Some(vec![ConstantRange(
13431343
lo.eval_bits(cx.tcx, cx.param_env, lo.ty),
13441344
hi.eval_bits(cx.tcx, cx.param_env, hi.ty),
@@ -1658,7 +1658,7 @@ fn constructor_covered_by_range<'tcx>(
16581658
) -> Result<bool, ErrorReported> {
16591659
let (from, to, end, ty) = match pat.kind {
16601660
box PatKind::Constant { value } => (value, value, RangeEnd::Included, value.ty),
1661-
box PatKind::Range(PatternRange { lo, hi, end }) => (lo, hi, end, lo.ty),
1661+
box PatKind::Range(PatRange { lo, hi, end }) => (lo, hi, end, lo.ty),
16621662
_ => bug!("`constructor_covered_by_range` called with {:?}", pat),
16631663
};
16641664
trace!("constructor_covered_by_range {:#?}, {:#?}, {:#?}, {}", ctor, from, to, ty);

src/librustc_mir/hair/pattern/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub enum PatKind<'tcx> {
158158
value: &'tcx ty::Const<'tcx>,
159159
},
160160

161-
Range(PatternRange<'tcx>),
161+
Range(PatRange<'tcx>),
162162

163163
/// Matches against a slice, checking the length and extracting elements.
164164
/// irrefutable when there is a slice pattern and both `prefix` and `suffix` are empty.
@@ -184,7 +184,7 @@ pub enum PatKind<'tcx> {
184184
}
185185

186186
#[derive(Copy, Clone, Debug, PartialEq)]
187-
pub struct PatternRange<'tcx> {
187+
pub struct PatRange<'tcx> {
188188
pub lo: &'tcx ty::Const<'tcx>,
189189
pub hi: &'tcx ty::Const<'tcx>,
190190
pub end: RangeEnd,
@@ -310,7 +310,7 @@ impl<'tcx> fmt::Display for Pattern<'tcx> {
310310
PatKind::Constant { value } => {
311311
write!(f, "{}", value)
312312
}
313-
PatKind::Range(PatternRange { lo, hi, end }) => {
313+
PatKind::Range(PatRange { lo, hi, end }) => {
314314
write!(f, "{}", lo)?;
315315
match end {
316316
RangeEnd::Included => write!(f, "..=")?,
@@ -471,7 +471,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
471471
);
472472
match (end, cmp) {
473473
(RangeEnd::Excluded, Some(Ordering::Less)) =>
474-
PatKind::Range(PatternRange { lo, hi, end }),
474+
PatKind::Range(PatRange { lo, hi, end }),
475475
(RangeEnd::Excluded, _) => {
476476
span_err!(
477477
self.tcx.sess,
@@ -485,7 +485,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
485485
PatKind::Constant { value: lo }
486486
}
487487
(RangeEnd::Included, Some(Ordering::Less)) => {
488-
PatKind::Range(PatternRange { lo, hi, end })
488+
PatKind::Range(PatRange { lo, hi, end })
489489
}
490490
(RangeEnd::Included, _) => {
491491
let mut err = struct_span_err!(

0 commit comments

Comments
 (0)