Skip to content

Commit 9ac0c27

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 170466 b: refs/heads/try c: bcc2120 h: refs/heads/master v: v3
1 parent 345de85 commit 9ac0c27

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 73a25f55ad748b4d3516417c711b99ce446591af
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5-
refs/heads/try: 24b49228f0dbd5a4b59a5297532f4b9cb4dfdc6a
5+
refs/heads/try: bcc2120c2134cd4359d160e55ebbc3c3bcb72f16
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc_borrowck/borrowck/move_data.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,17 @@ impl<'tcx> MoveData<'tcx> {
521521
return true;
522522
}
523523

524-
// FIXME(#19596) unbox `f`
525-
fn each_extending_path(&self, index: MovePathIndex, f: |MovePathIndex| -> bool) -> bool {
526-
if !f(index) {
524+
// FIXME(#19596) This is a workaround, but there should be better way to do this
525+
fn each_extending_path_<F>(&self, index: MovePathIndex, f: &mut F) -> bool where
526+
F: FnMut(MovePathIndex) -> bool,
527+
{
528+
if !(*f)(index) {
527529
return false;
528530
}
529531

530532
let mut p = self.path_first_child(index);
531533
while p != InvalidMovePathIndex {
532-
if !self.each_extending_path(p, |x| f(x)) {
534+
if !self.each_extending_path_(p, f) {
533535
return false;
534536
}
535537
p = self.path_next_sibling(p);
@@ -538,6 +540,12 @@ impl<'tcx> MoveData<'tcx> {
538540
return true;
539541
}
540542

543+
fn each_extending_path<F>(&self, index: MovePathIndex, mut f: F) -> bool where
544+
F: FnMut(MovePathIndex) -> bool,
545+
{
546+
self.each_extending_path_(index, &mut f)
547+
}
548+
541549
fn each_applicable_move<F>(&self, index0: MovePathIndex, mut f: F) -> bool where
542550
F: FnMut(MoveIndex) -> bool,
543551
{

0 commit comments

Comments
 (0)