Add barest-bones deref patterns

Co-authored-by: Deadbeef <ent3rm4n@gmail.com>
This commit is contained in:
Nadrieril 2024-03-08 19:17:23 +01:00
parent a128516cf9
commit 120d3570aa
16 changed files with 139 additions and 17 deletions

View file

@ -462,6 +462,12 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
_ => bug!("pattern has unexpected type: pat: {:?}, ty: {:?}", pat, ty),
};
}
PatKind::DerefPattern { .. } => {
// FIXME(deref_patterns): At least detect that `box _` is irrefutable.
fields = vec![];
arity = 0;
ctor = Opaque(OpaqueId::new());
}
PatKind::Leaf { subpatterns } | PatKind::Variant { subpatterns, .. } => {
match ty.kind() {
ty::Tuple(fs) => {