Struct rustc_mir::hair::pattern::PatternContext [−][src]
pub struct PatternContext<'a, 'tcx: 'a> { pub tcx: TyCtxt<'a, 'tcx, 'tcx>, pub param_env: ParamEnv<'tcx>, pub tables: &'a TypeckTables<'tcx>, pub substs: &'tcx Substs<'tcx>, pub 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?
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>