Struct rustc_mir_build::thir::pattern::PatCtxt [−][src]
pub(crate) struct PatCtxt<'a, 'tcx> {
pub(crate) tcx: TyCtxt<'tcx>,
pub(crate) param_env: ParamEnv<'tcx>,
pub(crate) typeck_results: &'a TypeckResults<'tcx>,
pub(crate) errors: Vec<PatternError>,
include_lint_checks: bool,
}Fields
tcx: TyCtxt<'tcx>param_env: ParamEnv<'tcx>typeck_results: &'a TypeckResults<'tcx>errors: Vec<PatternError>include_lint_checks: boolImplementations
impl PatCtxt<'_, '_>[src]
impl PatCtxt<'_, '_>[src]fn report_inlining_errors(&self, pat_span: Span)[src]
fn span_e0158(&self, span: Span, text: &str)[src]
impl<'a, 'tcx> PatCtxt<'a, 'tcx>[src]
impl<'a, 'tcx> PatCtxt<'a, 'tcx>[src]pub(super) fn const_to_pat(
&self,
cv: &'tcx Const<'tcx>,
id: HirId,
span: Span,
mir_structural_match_violation: bool
) -> Pat<'tcx>[src]
pub(super) fn const_to_pat(
&self,
cv: &'tcx Const<'tcx>,
id: HirId,
span: Span,
mir_structural_match_violation: bool
) -> Pat<'tcx>[src]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 compared via structural equality).
impl<'a, 'tcx> PatCtxt<'a, 'tcx>[src]
impl<'a, 'tcx> PatCtxt<'a, 'tcx>[src]pub(crate) fn new(
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> Self[src]
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> Self
pub(crate) fn include_lint_checks(&mut self) -> &mut Self[src]
pub(crate) fn lower_pattern(&mut self, pat: &'tcx Pat<'tcx>) -> Pat<'tcx>[src]
fn lower_range_expr(
&mut self,
expr: &'tcx Expr<'tcx>
) -> (PatKind<'tcx>, Option<Ascription<'tcx>>)[src]
&mut self,
expr: &'tcx Expr<'tcx>
) -> (PatKind<'tcx>, Option<Ascription<'tcx>>)
fn lower_pattern_range(
&mut self,
ty: Ty<'tcx>,
lo: &'tcx Const<'tcx>,
hi: &'tcx Const<'tcx>,
end: RangeEnd,
span: Span
) -> PatKind<'tcx>[src]
&mut self,
ty: Ty<'tcx>,
lo: &'tcx Const<'tcx>,
hi: &'tcx Const<'tcx>,
end: RangeEnd,
span: Span
) -> PatKind<'tcx>
fn normalize_range_pattern_ends(
&self,
ty: Ty<'tcx>,
lo: Option<&PatKind<'tcx>>,
hi: Option<&PatKind<'tcx>>
) -> Option<(&'tcx Const<'tcx>, &'tcx Const<'tcx>)>[src]
&self,
ty: Ty<'tcx>,
lo: Option<&PatKind<'tcx>>,
hi: Option<&PatKind<'tcx>>
) -> Option<(&'tcx Const<'tcx>, &'tcx Const<'tcx>)>
fn lower_pattern_unadjusted(&mut self, pat: &'tcx Pat<'tcx>) -> Pat<'tcx>[src]
fn lower_tuple_subpats(
&mut self,
pats: &'tcx [&'tcx Pat<'tcx>],
expected_len: usize,
gap_pos: Option<usize>
) -> Vec<FieldPat<'tcx>>[src]
&mut self,
pats: &'tcx [&'tcx Pat<'tcx>],
expected_len: usize,
gap_pos: Option<usize>
) -> Vec<FieldPat<'tcx>>
fn lower_patterns(&mut self, pats: &'tcx [&'tcx Pat<'tcx>]) -> Vec<Pat<'tcx>>[src]
fn lower_opt_pattern(
&mut self,
pat: &'tcx Option<&'tcx Pat<'tcx>>
) -> Option<Pat<'tcx>>[src]
&mut self,
pat: &'tcx Option<&'tcx Pat<'tcx>>
) -> Option<Pat<'tcx>>
fn slice_or_array_pattern(
&mut self,
span: Span,
ty: Ty<'tcx>,
prefix: &'tcx [&'tcx Pat<'tcx>],
slice: &'tcx Option<&'tcx Pat<'tcx>>,
suffix: &'tcx [&'tcx Pat<'tcx>]
) -> PatKind<'tcx>[src]
&mut self,
span: Span,
ty: Ty<'tcx>,
prefix: &'tcx [&'tcx Pat<'tcx>],
slice: &'tcx Option<&'tcx Pat<'tcx>>,
suffix: &'tcx [&'tcx Pat<'tcx>]
) -> PatKind<'tcx>
fn lower_variant_or_leaf(
&mut self,
res: Res,
hir_id: HirId,
span: Span,
ty: Ty<'tcx>,
subpatterns: Vec<FieldPat<'tcx>>
) -> PatKind<'tcx>[src]
&mut self,
res: Res,
hir_id: HirId,
span: Span,
ty: Ty<'tcx>,
subpatterns: Vec<FieldPat<'tcx>>
) -> PatKind<'tcx>
Trait Implementations
impl<'tcx> UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx>[src]
impl<'tcx> UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx>[src]fn tcx(&self) -> TyCtxt<'tcx>[src]
fn typeck_results(&self) -> &TypeckResults<'tcx>[src]
fn user_substs_applied_to_ty_of_hir_id(
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>[src]
fn user_substs_applied_to_ty_of_hir_id(
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>[src]Looks up the type associated with this hir-id and applies the user-given substitutions; the hir-id must map to a suitable type. Read more
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for PatCtxt<'a, 'tcx>
impl<'a, 'tcx> !Send for PatCtxt<'a, 'tcx>
impl<'a, 'tcx> !Sync for PatCtxt<'a, 'tcx>
impl<'a, 'tcx> Unpin for PatCtxt<'a, 'tcx> where
'tcx: 'a,
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for PatCtxt<'a, 'tcx>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,