Skip to content

Commit 57eeb61

Browse files
committed
or-patterns: remove Arm::contains_explicit_ref_binding.
1 parent 9ca42a5 commit 57eeb61

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

src/librustc/hir/pat_util.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -189,20 +189,3 @@ impl hir::Pat {
189189
result
190190
}
191191
}
192-
193-
impl hir::Arm {
194-
/// Checks if the patterns for this arm contain any `ref` or `ref mut`
195-
/// bindings, and if yes whether its containing mutable ones or just immutables ones.
196-
pub fn contains_explicit_ref_binding(&self) -> Option<hir::Mutability> {
197-
// FIXME(tschottdorf): contains_explicit_ref_binding() must be removed
198-
// for #42640 (default match binding modes).
199-
//
200-
// See #44848.
201-
self.top_pats_hack().iter()
202-
.filter_map(|pat| pat.contains_explicit_ref_binding())
203-
.max_by_key(|m| match *m {
204-
hir::MutMutable => 1,
205-
hir::MutImmutable => 0,
206-
})
207-
}
208-
}

src/librustc_typeck/check/_match.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
411411
//
412412
// See #44848.
413413
let contains_ref_bindings = arms.iter()
414-
.filter_map(|a| a.contains_explicit_ref_binding())
415-
.max_by_key(|m| match *m {
416-
hir::MutMutable => 1,
417-
hir::MutImmutable => 0,
418-
});
414+
.filter_map(|a| a.pat.contains_explicit_ref_binding())
415+
.max_by_key(|m| match *m {
416+
hir::MutMutable => 1,
417+
hir::MutImmutable => 0,
418+
});
419419

420420
if let Some(m) = contains_ref_bindings {
421421
self.check_expr_with_needs(discrim, Needs::maybe_mut_place(m))

0 commit comments

Comments
 (0)