Skip to content

Commit a76edb0

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163734 b: refs/heads/master c: 44b419b h: refs/heads/master v: v3
1 parent 26ae82d commit a76edb0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fd06ef24bb6e91a60dab2d1199acb810ff2875b3
2+
refs/heads/master: 44b419b82084e1dc1abd8f8cb4b603fe1c43483c
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42

trunk/src/librustc_trans/trans/basic_block.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct BasicBlock(pub BasicBlockRef);
1717

1818
impl Copy for BasicBlock {}
1919

20-
pub type Preds<'a> = Map<'a, Value, BasicBlock, Filter<'a, Value, Users>>;
20+
pub type Preds<'a> = Map<Value, BasicBlock, Filter<'a, Value, Users>, fn(Value) -> BasicBlock>;
2121

2222
/// Wrapper for LLVM BasicBlockRef
2323
impl BasicBlock {
@@ -32,9 +32,11 @@ impl BasicBlock {
3232
}
3333

3434
pub fn pred_iter(self) -> Preds<'static> {
35+
fn get_parent(user: Value) -> BasicBlock { user.get_parent().unwrap() }
36+
3537
self.as_value().user_iter()
3638
.filter(|user| user.is_a_terminator_inst())
37-
.map(|user| user.get_parent().unwrap())
39+
.map(get_parent)
3840
}
3941

4042
pub fn get_single_predecessor(self) -> Option<BasicBlock> {

0 commit comments

Comments
 (0)