Skip to content

Commit 4414f0d

Browse files
committed
is_binding_pat: treat or-pat like tuple-pat
1 parent ffbde9f commit 4414f0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc/middle/region.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ fn resolve_local<'tcx>(
11731173
/// | VariantName(..., P&, ...)
11741174
/// | [ ..., P&, ... ]
11751175
/// | ( ..., P&, ... )
1176+
/// | ... "|" P& "|" ...
11761177
/// | box P&
11771178
fn is_binding_pat(pat: &hir::Pat) -> bool {
11781179
// Note that the code below looks for *explicit* refs only, that is, it won't
@@ -1212,6 +1213,7 @@ fn resolve_local<'tcx>(
12121213
pats3.iter().any(|p| is_binding_pat(&p))
12131214
}
12141215

1216+
PatKind::Or(ref subpats) |
12151217
PatKind::TupleStruct(_, ref subpats, _) |
12161218
PatKind::Tuple(ref subpats, _) => {
12171219
subpats.iter().any(|p| is_binding_pat(&p))
@@ -1221,7 +1223,6 @@ fn resolve_local<'tcx>(
12211223
is_binding_pat(&subpat)
12221224
}
12231225

1224-
PatKind::Or(_) |
12251226
PatKind::Ref(_, _) |
12261227
PatKind::Binding(hir::BindingAnnotation::Unannotated, ..) |
12271228
PatKind::Binding(hir::BindingAnnotation::Mutable, ..) |

0 commit comments

Comments
 (0)