Skip to content

Commit 80a04b1

Browse files
author
Jorge Aparicio
committed
librustc_trans: fix fallout
1 parent e66ba15 commit 80a04b1

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/librustc_trans/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)]
2626
#![feature(slicing_syntax, unsafe_destructor)]
2727
#![feature(rustc_diagnostic_macros)]
28+
#![feature(unboxed_closures)]
2829

2930
extern crate arena;
3031
extern crate flate;

src/librustc_trans/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ fn pick_column_to_specialize(def_map: &DefMap, m: &[Match]) -> Option<uint> {
771771
}
772772
};
773773

774-
let column_contains_any_nonwild_patterns: |&uint| -> bool = |&col| {
774+
let column_contains_any_nonwild_patterns = |&: &col: &uint| -> bool {
775775
m.iter().any(|row| match row.pats[col].node {
776776
ast::PatWild(_) => false,
777777
_ => true

src/librustc_trans/trans/basic_block.rs

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

1818
impl Copy for BasicBlock {}
1919

20-
pub type Preds<'a> = Map<Value, BasicBlock, Filter<'a, Value, Users>, fn(Value) -> BasicBlock>;
20+
pub type Preds = Map<
21+
Value,
22+
BasicBlock,
23+
Filter<Value, Users, fn(&Value) -> bool>,
24+
fn(Value) -> BasicBlock,
25+
>;
2126

2227
/// Wrapper for LLVM BasicBlockRef
2328
impl BasicBlock {
@@ -31,11 +36,12 @@ impl BasicBlock {
3136
}
3237
}
3338

34-
pub fn pred_iter(self) -> Preds<'static> {
39+
pub fn pred_iter(self) -> Preds {
40+
fn is_a_terminator_inst(user: &Value) -> bool { user.is_a_terminator_inst() }
3541
fn get_parent(user: Value) -> BasicBlock { user.get_parent().unwrap() }
3642

3743
self.as_value().user_iter()
38-
.filter(|user| user.is_a_terminator_inst())
44+
.filter(is_a_terminator_inst)
3945
.map(get_parent)
4046
}
4147

0 commit comments

Comments
 (0)