rustc_pattern_analysis::rustc

Type Alias Usefulness

Source
pub type Usefulness<'p, 'tcx> = Usefulness<'p, RustcPatCtxt<'p, 'tcx>>;

Aliased Type§

enum Usefulness<'p, 'tcx> {
    Useful(Vec<(&'p DeconstructedPat<RustcPatCtxt<'p, 'tcx>>, RedundancyExplanation<'p, RustcPatCtxt<'p, 'tcx>>)>),
    Redundant(RedundancyExplanation<'p, RustcPatCtxt<'p, 'tcx>>),
}

Variants§

§

Useful(Vec<(&'p DeconstructedPat<RustcPatCtxt<'p, 'tcx>>, RedundancyExplanation<'p, RustcPatCtxt<'p, 'tcx>>)>)

The arm is useful. This additionally carries a set of or-pattern branches that have been found to be redundant despite the overall arm being useful. Used only in the presence of or-patterns, otherwise it stays empty.

§

Redundant(RedundancyExplanation<'p, RustcPatCtxt<'p, 'tcx>>)

The arm is redundant and can be removed without changing the behavior of the match expression.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes

Size for each variant:

  • Useful: 24 bytes
  • Redundant: 24 bytes

Trait Implementations

Source§

impl<'p, Cx: Clone + PatCx> Clone for Usefulness<'p, Cx>

Source§

fn clone(&self) -> Usefulness<'p, Cx>

Returns a copy of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'p, Cx: Debug + PatCx> Debug for Usefulness<'p, Cx>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more