@@ -586,9 +586,9 @@ enum Constructor<'tcx> {
586
586
ConstantValue ( & ' tcx ty:: Const < ' tcx > , Span ) ,
587
587
/// Ranges of literal values (`2..=5` and `2..5`).
588
588
ConstantRange ( u128 , u128 , Ty < ' tcx > , RangeEnd , Span ) ,
589
- /// Array patterns of length n .
589
+ /// Array patterns of length `n` .
590
590
FixedLenSlice ( u64 ) ,
591
- /// Slice patterns. Captures any array constructor of length >= i+j .
591
+ /// Slice patterns. Captures any array constructor of ` length >= i + j` .
592
592
VarLenSlice ( u64 , u64 ) ,
593
593
}
594
594
@@ -616,8 +616,7 @@ impl<'tcx> std::cmp::PartialEq for Constructor<'tcx> {
616
616
impl < ' tcx > Constructor < ' tcx > {
617
617
fn is_slice ( & self ) -> bool {
618
618
match self {
619
- FixedLenSlice { .. } => true ,
620
- VarLenSlice { .. } => true ,
619
+ FixedLenSlice { .. } | VarLenSlice { .. } => true ,
621
620
_ => false ,
622
621
}
623
622
}
@@ -687,13 +686,13 @@ impl<'tcx> Constructor<'tcx> {
687
686
688
687
// For each used ctor, subtract from the current set of constructors.
689
688
// Naming: we remove the "neg" constructors from the "pos" ones.
690
- // Remember, VarLenSlice(i, j) covers the union of FixedLenSlice from
691
- // i+j to infinity.
689
+ // Remember, ` VarLenSlice(i, j)` covers the union of ` FixedLenSlice` from
690
+ // `i + j` to infinity.
692
691
for neg_ctor in other_ctors {
693
692
remaining_ctors = remaining_ctors
694
693
. into_iter ( )
695
694
. flat_map ( |pos_ctor| -> SmallVec < [ Constructor < ' tcx > ; 1 ] > {
696
- // Compute pos_ctor \ neg_ctor
695
+ // Compute ` pos_ctor \ neg_ctor`.
697
696
match ( & pos_ctor, neg_ctor) {
698
697
( & FixedLenSlice ( pos_len) , & VarLenSlice ( neg_prefix, neg_suffix) ) => {
699
698
let neg_len = neg_prefix + neg_suffix;
@@ -722,7 +721,7 @@ impl<'tcx> Constructor<'tcx> {
722
721
} else {
723
722
( pos_len..neg_len)
724
723
. map ( FixedLenSlice )
725
- // We know neg_len + 1 >= pos_len >= pos_suffix
724
+ // We know that ` neg_len + 1 >= pos_len >= pos_suffix`.
726
725
. chain ( Some ( VarLenSlice (
727
726
neg_len + 1 - pos_suffix,
728
727
pos_suffix,
@@ -2081,7 +2080,7 @@ fn split_grouped_constructors<'p, 'tcx>(
2081
2080
}
2082
2081
2083
2082
// For diagnostics, we keep the prefix and suffix lengths separate, so in the case
2084
- // where `max_fixed_len+ 1` is the largest, we adapt `max_prefix_len` accordingly,
2083
+ // where `max_fixed_len + 1` is the largest, we adapt `max_prefix_len` accordingly,
2085
2084
// so that `L = max_prefix_len + max_suffix_len`.
2086
2085
if max_fixed_len + 1 >= max_prefix_len + max_suffix_len {
2087
2086
// The subtraction can't overflow thanks to the above check.
0 commit comments