[−][src]Function rustc_mir_build::thir::pattern::_match::all_constructors
pub(in thir::pattern::_match) fn all_constructors<'p, 'tcx>(
pcx: PatCtxt<'_, 'p, 'tcx>
) -> Vec<Constructor<'tcx>>
This determines the set of all possible constructors of a pattern matching
values of type left_ty. For vectors, this would normally be an infinite set
but is instead bounded by the maximum fixed length of slice patterns in
the column of patterns being analyzed.
We make sure to omit constructors that are statically impossible. E.g., for
Option<!>, we do not include Some(_) in the returned list of constructors.
Invariant: this returns an empty Vec if and only if the type is uninhabited (as determined by
cx.is_uninhabited()).