Skip to content

Commit d8b71d4

Browse files
committed
Be more consistent in terminology
1 parent defc66d commit d8b71d4

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/librustc_mir/hair/pattern/_match.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,22 @@
166166
/// is the wildcard `_`, which stands for all the constructors of a given type.
167167
///
168168
/// In practice, the meta-constructors we make use of in this file are the following:
169-
/// - any normal constructor is also a metaconstructor with exactly one member;
169+
/// - any normal constructor is also a meta-constructor with exactly one member;
170170
/// - the wildcard `_`, that captures all constructors of a given type;
171171
/// - the constant range `x..y` that captures a range of values for types that support
172172
/// it, like integers;
173173
/// - the variable-length slice `[x, y, .., z]`, that captures all slice constructors
174174
/// from a given length onwards;
175-
/// - the "missing constructors" metaconstructor, that captures a provided arbitrary group
175+
/// - the "missing constructors" meta-constructor, that captures a provided arbitrary group
176176
/// of constructors.
177177
///
178-
/// We first redefine `pat_constructors` to potentially return a metaconstructor when relevant
178+
/// We first redefine `pat_constructors` to potentially return a meta-constructor when relevant
179179
/// for a pattern.
180180
///
181-
/// We then add a step to the algorithm: a function `split_metaconstructor(mc, M)` that returns
182-
/// a list of metaconstructors, with the following properties:
181+
/// We then add a step to the algorithm: a function `split_meta_constructor(mc, M)` that returns
182+
/// a list of meta-constructors, with the following properties:
183183
/// - the set of base constructors covered by the output must be the same as covered by `mc`;
184-
/// - for each metaconstructor `k` in the output, all the `c ϵ k` behave the same relative
184+
/// - for each meta-constructor `k` in the output, all the `c ϵ k` behave the same relative
185185
/// to `M`. More precisely, we want that for any two `c1` and `c2` in `k`,
186186
/// `U(S(c1, M), S(c1, p))` iff `U(S(c2, M), S(c2, p))`;
187187
/// - if the first column of `M` is only wildcards, then the function returns at most
@@ -207,7 +207,7 @@
207207
/// Thus we get the new inductive step (i.e. when `n > 0`):
208208
/// `U(M, p) :=
209209
/// ∃(mc ϵ pat_constructors(p_1))
210-
/// ∃(mc' ϵ split_metaconstructor(mc, M))
210+
/// ∃(mc' ϵ split_meta-constructor(mc, M))
211211
/// U(S(c, M), S(c, p)) for some c ϵ mc'`
212212
/// Note: in the case of an uninhabited type, there won't be any `mc'` so this just returns false.
213213
///
@@ -570,7 +570,7 @@ impl<'a, 'tcx> MatchCheckCtxt<'a, 'tcx> {
570570
}
571571
}
572572

573-
/// Constructors, including base constructors and metaconstructors.
573+
/// Constructors, including base constructors and meta-constructors.
574574
#[derive(Clone, Debug, PartialEq)]
575575
enum Constructor<'tcx> {
576576
// Base constructors
@@ -589,7 +589,7 @@ enum Constructor<'tcx> {
589589
ConstantRange(&'tcx ty::Const<'tcx>, &'tcx ty::Const<'tcx>, RangeEnd),
590590
/// Slice patterns. Captures any array constructor of length >= i+j.
591591
VarLenSlice(u64, u64),
592-
/// Wildcard metaconstructor. Captures all possible constructors for a given type.
592+
/// Wildcard meta-constructor. Captures all possible constructors for a given type.
593593
Wildcard,
594594
/// Special wildcard-like constructor that carries only a subset of all possible constructors.
595595
/// It is used only when splitting `Constructor::Wildcard` and some constructors were not
@@ -882,13 +882,13 @@ impl<'tcx> Constructor<'tcx> {
882882
} else if !missing_ctors.is_empty() {
883883
if head_ctors.is_empty() {
884884
// If head_ctors is empty, then all constructors of the type behave the same
885-
// so we can keep the Wildcard metaconstructor.
885+
// so we can keep the Wildcard meta-constructor.
886886
smallvec![Wildcard]
887887
} else {
888888
// Otherwise, we have a set of missing constructors that is neither empty
889889
// not equal to all_constructors. Since all missing constructors will
890890
// behave the same (i.e. will be matched only by wildcards), we return a
891-
// metaconstructor that contains all of them at once.
891+
// meta-constructor that contains all of them at once.
892892
smallvec![MissingConstructors(missing_ctors)]
893893
}
894894
} else {
@@ -921,7 +921,7 @@ impl<'tcx> Constructor<'tcx> {
921921
assert!(!used_ctors.iter().any(|c| c.is_wildcard()));
922922

923923
match self {
924-
// Those constructors can't intersect with a non-wildcard metaconstructor, so we're
924+
// Those constructors can't intersect with a non-wildcard meta-constructor, so we're
925925
// fine just comparing for equality.
926926
Single | Variant(_) => {
927927
if used_ctors.iter().any(|c| c == &self) {
@@ -1380,7 +1380,7 @@ impl<'tcx> Witness<'tcx> {
13801380
}
13811381

13821382
/// This determines the set of all possible constructors of a pattern matching
1383-
/// values of type `ty`. We possibly return metaconstructors like integer ranges
1383+
/// values of type `ty`. We possibly return meta-constructors like integer ranges
13841384
/// that capture several base constructors at once.
13851385
///
13861386
/// We make sure to omit constructors that are statically impossible. E.g., for

0 commit comments

Comments
 (0)