166
166
/// is the wildcard `_`, which stands for all the constructors of a given type.
167
167
///
168
168
/// 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;
170
170
/// - the wildcard `_`, that captures all constructors of a given type;
171
171
/// - the constant range `x..y` that captures a range of values for types that support
172
172
/// it, like integers;
173
173
/// - the variable-length slice `[x, y, .., z]`, that captures all slice constructors
174
174
/// 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
176
176
/// of constructors.
177
177
///
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
179
179
/// for a pattern.
180
180
///
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:
183
183
/// - 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
185
185
/// to `M`. More precisely, we want that for any two `c1` and `c2` in `k`,
186
186
/// `U(S(c1, M), S(c1, p))` iff `U(S(c2, M), S(c2, p))`;
187
187
/// - if the first column of `M` is only wildcards, then the function returns at most
207
207
/// Thus we get the new inductive step (i.e. when `n > 0`):
208
208
/// `U(M, p) :=
209
209
/// ∃(mc ϵ pat_constructors(p_1))
210
- /// ∃(mc' ϵ split_metaconstructor (mc, M))
210
+ /// ∃(mc' ϵ split_meta-constructor (mc, M))
211
211
/// U(S(c, M), S(c, p)) for some c ϵ mc'`
212
212
/// Note: in the case of an uninhabited type, there won't be any `mc'` so this just returns false.
213
213
///
@@ -570,7 +570,7 @@ impl<'a, 'tcx> MatchCheckCtxt<'a, 'tcx> {
570
570
}
571
571
}
572
572
573
- /// Constructors, including base constructors and metaconstructors .
573
+ /// Constructors, including base constructors and meta-constructors .
574
574
#[ derive( Clone , Debug , PartialEq ) ]
575
575
enum Constructor < ' tcx > {
576
576
// Base constructors
@@ -589,7 +589,7 @@ enum Constructor<'tcx> {
589
589
ConstantRange ( & ' tcx ty:: Const < ' tcx > , & ' tcx ty:: Const < ' tcx > , RangeEnd ) ,
590
590
/// Slice patterns. Captures any array constructor of length >= i+j.
591
591
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.
593
593
Wildcard ,
594
594
/// Special wildcard-like constructor that carries only a subset of all possible constructors.
595
595
/// It is used only when splitting `Constructor::Wildcard` and some constructors were not
@@ -882,13 +882,13 @@ impl<'tcx> Constructor<'tcx> {
882
882
} else if !missing_ctors. is_empty ( ) {
883
883
if head_ctors. is_empty ( ) {
884
884
// 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 .
886
886
smallvec ! [ Wildcard ]
887
887
} else {
888
888
// Otherwise, we have a set of missing constructors that is neither empty
889
889
// not equal to all_constructors. Since all missing constructors will
890
890
// 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.
892
892
smallvec ! [ MissingConstructors ( missing_ctors) ]
893
893
}
894
894
} else {
@@ -921,7 +921,7 @@ impl<'tcx> Constructor<'tcx> {
921
921
assert ! ( !used_ctors. iter( ) . any( |c| c. is_wildcard( ) ) ) ;
922
922
923
923
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
925
925
// fine just comparing for equality.
926
926
Single | Variant ( _) => {
927
927
if used_ctors. iter ( ) . any ( |c| c == & self ) {
@@ -1380,7 +1380,7 @@ impl<'tcx> Witness<'tcx> {
1380
1380
}
1381
1381
1382
1382
/// 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
1384
1384
/// that capture several base constructors at once.
1385
1385
///
1386
1386
/// We make sure to omit constructors that are statically impossible. E.g., for
0 commit comments