[−][src]Struct rustc_mir::hair::pattern::PatternContext
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Fields
tcx: TyCtxt<'a, 'tcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
param_env: ParamEnv<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
tables: &'a TypeckTables<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
substs: &'tcx Substs<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
errors: Vec<PatternError>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl<'a, 'tcx> PatternContext<'a, 'tcx>[src]
impl<'a, 'tcx> PatternContext<'a, 'tcx>fn report_inlining_errors(&self, pat_span: Span)[src]
fn report_inlining_errors(&self, pat_span: Span)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn span_e0158(&self, span: Span, text: &str)[src]
fn span_e0158(&self, span: Span, text: &str)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'a, 'tcx> PatternContext<'a, 'tcx>[src]
impl<'a, 'tcx> PatternContext<'a, 'tcx>pub fn new(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env_and_substs: ParamEnvAnd<'tcx, &'tcx Substs<'tcx>>,
tables: &'a TypeckTables<'tcx>
) -> Self[src]
pub fn new(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env_and_substs: ParamEnvAnd<'tcx, &'tcx Substs<'tcx>>,
tables: &'a TypeckTables<'tcx>
) -> Self🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn lower_pattern(&mut self, pat: &'tcx Pat) -> Pattern<'tcx>[src]
pub fn lower_pattern(&mut self, pat: &'tcx Pat) -> Pattern<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lower_pattern_unadjusted(&mut self, pat: &'tcx Pat) -> Pattern<'tcx>[src]
fn lower_pattern_unadjusted(&mut self, pat: &'tcx Pat) -> Pattern<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lower_patterns(&mut self, pats: &'tcx [P<Pat>]) -> Vec<Pattern<'tcx>>[src]
fn lower_patterns(&mut self, pats: &'tcx [P<Pat>]) -> Vec<Pattern<'tcx>>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lower_opt_pattern(
&mut self,
pat: &'tcx Option<P<Pat>>
) -> Option<Pattern<'tcx>>[src]
fn lower_opt_pattern(
&mut self,
pat: &'tcx Option<P<Pat>>
) -> Option<Pattern<'tcx>>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn flatten_nested_slice_patterns(
&mut self,
prefix: Vec<Pattern<'tcx>>,
slice: Option<Pattern<'tcx>>,
suffix: Vec<Pattern<'tcx>>
) -> (Vec<Pattern<'tcx>>, Option<Pattern<'tcx>>, Vec<Pattern<'tcx>>)[src]
fn flatten_nested_slice_patterns(
&mut self,
prefix: Vec<Pattern<'tcx>>,
slice: Option<Pattern<'tcx>>,
suffix: Vec<Pattern<'tcx>>
) -> (Vec<Pattern<'tcx>>, Option<Pattern<'tcx>>, Vec<Pattern<'tcx>>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn slice_or_array_pattern(
&mut self,
span: Span,
ty: Ty<'tcx>,
prefix: &'tcx [P<Pat>],
slice: &'tcx Option<P<Pat>>,
suffix: &'tcx [P<Pat>]
) -> PatternKind<'tcx>[src]
fn slice_or_array_pattern(
&mut self,
span: Span,
ty: Ty<'tcx>,
prefix: &'tcx [P<Pat>],
slice: &'tcx Option<P<Pat>>,
suffix: &'tcx [P<Pat>]
) -> PatternKind<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lower_variant_or_leaf(
&mut self,
def: Def,
span: Span,
ty: Ty<'tcx>,
subpatterns: Vec<FieldPattern<'tcx>>
) -> PatternKind<'tcx>[src]
fn lower_variant_or_leaf(
&mut self,
def: Def,
span: Span,
ty: Ty<'tcx>,
subpatterns: Vec<FieldPattern<'tcx>>
) -> PatternKind<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lower_path(&mut self, qpath: &QPath, id: HirId, span: Span) -> Pattern<'tcx>[src]
fn lower_path(&mut self, qpath: &QPath, id: HirId, span: Span) -> Pattern<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Takes a HIR Path. If the path is a constant, evaluates it and feeds
it to const_to_pat. Any other path (like enum variants without fields)
is converted to the corresponding pattern via lower_variant_or_leaf
fn lower_lit(&mut self, expr: &'tcx Expr) -> PatternKind<'tcx>[src]
fn lower_lit(&mut self, expr: &'tcx Expr) -> PatternKind<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Converts literals, paths and negation of literals to patterns. The special case for negation exists to allow things like -128i8 which would overflow if we tried to evaluate 128i8 and then negate afterwards.
fn const_to_pat(
&self,
instance: Instance<'tcx>,
cv: &'tcx Const<'tcx>,
id: HirId,
span: Span
) -> Pattern<'tcx>[src]
fn const_to_pat(
&self,
instance: Instance<'tcx>,
cv: &'tcx Const<'tcx>,
id: HirId,
span: Span
) -> Pattern<'tcx>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Converts an evaluated constant to a pattern (if possible). This means aggregate values (like structs and enums) are converted to a pattern that matches the value (as if you'd compare via eq).
Auto Trait Implementations
impl<'a, 'tcx> !Send for PatternContext<'a, 'tcx>
impl<'a, 'tcx> !Send for PatternContext<'a, 'tcx>impl<'a, 'tcx> !Sync for PatternContext<'a, 'tcx>
impl<'a, 'tcx> !Sync for PatternContext<'a, 'tcx>Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T[src]
fn borrow(&self) -> &TImmutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<E> SpecializationError for E[src]
impl<E> SpecializationError for Efn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized, [src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S is the encoder/decoder state type, T is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T[src]
impl<T> Erased for Timpl<T> Send for T where
T: ?Sized, [src]
impl<T> Send for T where
T: ?Sized, impl<T> Sync for T where
T: ?Sized, [src]
impl<T> Sync for T where
T: ?Sized, impl<T> Erased for T
impl<T> Erased for Timpl<T> MaybeResult for T[src]
impl<T> MaybeResult for Tfn from_ok(x: T) -> T[src]
fn from_ok(x: T) -> T🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn map_same<F>(self, f: F) -> T where
F: FnOnce(T) -> T, [src]
fn map_same<F>(self, f: F) -> T where
F: FnOnce(T) -> T, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'a, T> Captures for T where
T: ?Sized, [src]
impl<'a, T> Captures for T where
T: ?Sized,