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_patterns feature is enabled and weβre matching against a scrutinee of type
Cow<'a, Option<u8>>, we insert an implicit dereference to allow the pattern Some(_) to type,
but we must not dereference it when checking the pattern Cow::Borrowed(_).
ref mut bindings (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: