Expand description
Type inference for patterns.
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(_).
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:- PatOrigin π
- Peel
Kind π - Restrictions on what types to peel when adjusting the expected type and binding mode.
- Resolved
PatKind π