Rollup merge of #124047 - Jules-Bertholet:match-ergonomics-cleanups, r=Nadrieril

Match ergonomics 2024: miscellaneous code cleanups

- Store `ByRef` instead of `BindingAnnotation` in `PatInfo`
- Rename `BindingAnnotation` to `BindingMode`

r? ``@Nadrieril``

cc #123076

``@rustbot`` label A-patterns
This commit is contained in:
Matthias Krüger 2024-04-18 08:37:48 +02:00 committed by GitHub
commit 7add0bdf7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 254 additions and 286 deletions

View file

@ -654,7 +654,7 @@ fn resolve_local<'tcx>(
// & expression, and its lifetime would be extended to the end of the block (due
// to a different rule, not the below code).
match pat.kind {
PatKind::Binding(hir::BindingAnnotation(hir::ByRef::Yes(_), _), ..) => true,
PatKind::Binding(hir::BindingMode(hir::ByRef::Yes(_), _), ..) => true,
PatKind::Struct(_, field_pats, _) => field_pats.iter().any(|fp| is_binding_pat(fp.pat)),
@ -671,7 +671,7 @@ fn resolve_local<'tcx>(
PatKind::Box(subpat) | PatKind::Deref(subpat) => is_binding_pat(subpat),
PatKind::Ref(_, _)
| PatKind::Binding(hir::BindingAnnotation(hir::ByRef::No, _), ..)
| PatKind::Binding(hir::BindingMode(hir::ByRef::No, _), ..)
| PatKind::Wild
| PatKind::Never
| PatKind::Path(_)