pub(super) fn split<'p>(
        &self,
        pcx: PatCtxt<'_, 'p, 'tcx>,
        hir_id: Option<HirId>,
    ) -> SmallVec<[Self; 1]> {
        debug!("Constructor::split({:#?}, {:#?})", self, pcx.matrix);

        match self {
            Wildcard => Constructor::split_wildcard(pcx),
            // Fast-track if the range is trivial. In particular, we don't do the overlapping
            // ranges check.
            IntRange(ctor_range)
                if ctor_range.treat_exhaustively(pcx.cx.tcx) && !ctor_range.is_singleton() =>
            {
                ctor_range.split(pcx, hir_id)
            }
            Slice(slice @ Slice { kind: VarLen(..), .. }) => slice.split(pcx),
            // Any other constructor can be used unchanged.
            _ => smallvec![self.clone()],
        }
    }
/// Some constructors (namely `Wildcard`, `IntRange` and `Slice`) actually stand for a set of actual
/// constructors (like variants, integers or fixed-sized slices). When specializing for these
/// constructors, we want to be specialising for the actual underlying constructors.
/// Naively, we would simply return the list of constructors they correspond to. We instead are
/// more clever: if there are constructors that we know will behave the same wrt the current
/// matrix, we keep them grouped. For example, all slices of a sufficiently large length
/// will either be all useful or all non-useful with a given matrix.
///
/// See the branches for details on how the splitting is done.
///
/// This function may discard some irrelevant constructors if this preserves behavior and
/// diagnostics. Eg. for the `_` case, we ignore the constructors already present in the
/// matrix, unless all of them are.
///
/// `hir_id` is `None` when we're evaluating the wildcard pattern. In that case we do not want
/// to lint for overlapping ranges.


See the branches for details on how the splitting is done.

This function may discard some irrelevant constructors if this preserves behavior and
diagnostics. Eg. for the `_` case, we ignore the constructors already present in the
matrix, unless all of them are.

`hir_id` is `None` when we're evaluating the wildcard pattern. In that case we do not want
to lint for overlapping ranges.
See the branches for details on how the splitting is done . This function may discard some irrelevant constructors if this preserves behavior and diagnostics . Eg . for the ` _ ` case we ignore the constructors already present in the matrix unless all of them are . ` hir_id ` is ` None ` when we ' re evaluating the wildcard pattern . In that case we do not want to lint for overlapping ranges .
pub(super) fn split<'p>(
        &self,
        pcx: PatCtxt<'_, 'p, 'tcx>,
        hir_id: Option<HirId>,
    ) -> SmallVec<[Self; 1]> {
        debug!("Constructor::split({:#?}, {:#?})", self, pcx.matrix);
        match self {
            Wildcard => Constructor::split_wildcard(pcx),
            // Fast-track if the range is trivial. In particular, we don't do the overlapping
            // ranges check.
            IntRange(ctor_range)
                if ctor_range.treat_exhaustively(pcx.cx.tcx) && !ctor_range.is_singleton() =>
            {
                ctor_range.split(pcx, hir_id)
            }
            Slice(slice @ Slice { kind: VarLen(..), .. }) => slice.split(pcx),
            // Any other constructor can be used unchanged.
            _ => smallvec![self.clone()],
        }
    }
pub ( super ) fn split < ' p > ( & self , pcx : PatCtxt < ' _ , ' p , ' tcx > , hir_id : Option < HirId > , ) -> SmallVec < [ Self ; 1 ] > { debug ! ( " " self pcx matrix ) ; match self { Wildcard => Constructor :: split_wildcard ( pcx ) , // Fast-track if the range is trivial. In particular, we don't do the overlapping // ranges check. IntRange ( ctor_range ) if ctor_range . treat_exhaustively ( pcx . cx . tcx ) && ! ctor_range . is_singleton ( ) => { ctor_range . split ( pcx , hir_id ) } Slice ( slice @ Slice { kind : VarLen ( .. ) , .. } ) => slice . split ( pcx ) , // Any other constructor can be used unchanged. _ => smallvec ! [ self clone ( ) ] , } }
Some constructors (namely `Wildcard`, `IntRange` and `Slice`) actually stand for a set of actual
constructors (like variants, integers or fixed-sized slices).
Some constructors ( namely ` Wildcard ` ` IntRange ` and ` Slice ` ) actually stand for a set of actual constructors ( like variants integers or fixed - sized slices ) .
&self
pcx
PatCtxt<'_, 'p, 'tcx>
hir_id
Option<HirId>
&self
pcx
PatCtxt<'_, 'p, 'tcx>
hir_id
Option<HirId>