Re-exportsΒ§
use std::collections::hash_map::Entry::Occupied;πuse std::collections::hash_map::Entry::Vacant;πuse std::assert_matches;πuse std::cmp;πuse rustc_abi::FieldIdx;πuse rustc_ast as ast;πuse rustc_attr_ir::lang_items::LangItem;πuse rustc_data_structures::fx::FxHashMap;πuse rustc_errors::Applicability;πuse rustc_errors::Diag;πuse rustc_errors::DiagCtxtHandle;πuse rustc_errors::Diagnostic;πuse rustc_errors::ErrorGuaranteed;πuse rustc_errors::Level;πuse rustc_errors::MultiSpan;πuse rustc_errors::pluralize;πuse rustc_errors::struct_span_code_err;πuse rustc_hir::def::CtorKind;πuse rustc_hir::def::DefKind;πuse rustc_hir::def::Res;πuse rustc_hir::def_id::DefId;πuse rustc_hir::pat_util::EnumerateAndAdjustIterator;πuse rustc_hir as hir;πuse rustc_hir::BindingMode;πuse rustc_hir::ByRef;πuse rustc_hir::ExprKind;πuse rustc_hir::HirId;πuse rustc_hir::Mutability;πuse rustc_hir::Pat;πuse rustc_hir::PatExpr;πuse rustc_hir::PatExprKind;πuse rustc_hir::PatKind;πuse rustc_hir::expr_needs_parens;πuse rustc_hir_analysis::autoderef::report_autoderef_recursion_limit_error;πuse rustc_infer::infer::RegionVariableOrigin;πuse rustc_lint_defs::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;πuse rustc_middle::traits::PatternOriginExpr;πuse rustc_middle::ty;πuse rustc_middle::ty::Pinnedness;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TypeVisitableExt;πuse rustc_middle::ty::Unnormalized;πuse rustc_session::diagnostics::feature_err;πuse rustc_span::edit_distance::find_best_match_for_name;πuse rustc_span::edition::Edition;πuse rustc_span::BytePos;πuse rustc_span::DUMMY_SP;πuse rustc_span::Ident;πuse rustc_span::Span;πuse rustc_span::bug;πuse rustc_span::kw;πuse rustc_span::span_bug;πuse rustc_span::sym;πuse rustc_trait_selection::infer::InferCtxtExt;πuse rustc_trait_selection::traits::ObligationCause;πuse rustc_trait_selection::traits::ObligationCauseCode;πuse tracing::debug;πuse tracing::instrument;πuse tracing::instrument;πuse tracing::trace;πuse ty::VariantDef;πuse ty::adjustment::PatAdjust;πuse ty::adjustment::PatAdjustment;πuse crate::expectation::Expectation;πuse crate::gather_locals::DeclOrigin;πuse crate::FnCtxt;πuse crate::diagnostics;πuse rustc_errors::codes::*;π
StructsΒ§
- PatInfo π
- Resolved
Pat π - When checking patterns containing paths, we need to know the pathβs resolution to determine
whether to apply match ergonomics and implicitly dereference the scrutinee. For instance, when
the
deref_patternsfeature is enabled and weβre matching against a scrutinee of typeCow<'a, Option<u8>>, we insert an implicit dereference to allow the patternSome(_)to type, but we must not dereference it when checking the patternCow::Borrowed(_). - TopInfo π
- Information about the expected type at the top level of type checking a pattern.
EnumsΒ§
- Adjust
Mode π - Mode for adjusting the expected type and binding mode.
- Inherited
RefMatch πRule - Variations on RFC 3627βs Rule 4: when do reference patterns match against inherited references?
- Mutbl
Cap π ref mutbindings (explicit or match-ergonomics) are not allowed behind an&reference. Normally, the borrow checker enforces this, but for (currently experimental) match ergonomics, we track this when typing patterns for two purposes:- Peel
Kind π - Restrictions on what types to peel when adjusting the expected type and binding mode.
- Pinnedness
Cap π reforref mutbindings (not pinned, explicitly or match-ergonomics) are only allowed behind an&pinreference if the bindingβs type isUnpin.- Resolved
PatKind π
ConstantsΒ§
FunctionsΒ§
- is_
number π