diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-30 20:58:47 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-31 22:50:27 -0500 |
| commit | e47035b9a58e4dd0cda075928bb93df0b7b25372 (patch) | |
| tree | b7a2da607b0845e171fe90bcd3fad23faf41ca79 | |
| parent | 1e4bbefae126be24cb443252039ef0fd5ccba62c (diff) | |
| download | rust-e47035b9a58e4dd0cda075928bb93df0b7b25372.tar.gz rust-e47035b9a58e4dd0cda075928bb93df0b7b25372.zip | |
rustc_trans: unbox closures used in let bindings
| -rw-r--r-- | src/librustc_trans/back/link.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/back/write.rs | 8 | ||||
| -rw-r--r-- | src/librustc_trans/trans/_match.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/trans/base.rs | 8 | ||||
| -rw-r--r-- | src/librustc_trans/trans/consts.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/trans/debuginfo.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/trans/foreign.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/trans/intrinsic.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/trans/monomorphize.rs | 4 |
9 files changed, 16 insertions, 16 deletions
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index 39ba2a98ce4..93ff9f53ec1 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -127,7 +127,7 @@ pub const RLIB_BYTECODE_OBJECT_V1_DATA_OFFSET: uint = pub fn find_crate_name(sess: Option<&Session>, attrs: &[ast::Attribute], input: &Input) -> String { - let validate = |s: String, span: Option<Span>| { + let validate = |&: s: String, span: Option<Span>| { creader::validate_crate_name(sess, s[], span); s }; diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 99e11bf5202..a6f2c7dfed0 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -431,7 +431,7 @@ unsafe fn optimize_and_codegen(cgcx: &CodegenContext, // If we're verifying or linting, add them to the function pass // manager. - let addpass = |pass: &str| { + let addpass = |&: pass: &str| { pass.with_c_str(|s| llvm::LLVMRustAddPass(fpm, s)) }; if !config.no_verify { assert!(addpass("verify")); } @@ -652,7 +652,7 @@ pub fn run_passes(sess: &Session, // Produce final compile outputs. - let copy_if_one_unit = |ext: &str, output_type: config::OutputType, keep_numbered: bool| { + let copy_if_one_unit = |&: ext: &str, output_type: config::OutputType, keep_numbered: bool| { // Three cases: if sess.opts.cg.codegen_units == 1 { // 1) Only one codegen unit. In this case it's no difficulty @@ -677,7 +677,7 @@ pub fn run_passes(sess: &Session, } }; - let link_obj = |output_path: &Path| { + let link_obj = |&: output_path: &Path| { // Running `ld -r` on a single input is kind of pointless. if sess.opts.cg.codegen_units == 1 { fs::copy(&crate_output.with_extension("0.o"), @@ -993,7 +993,7 @@ unsafe fn configure_llvm(sess: &Session) { let mut llvm_c_strs = Vec::new(); let mut llvm_args = Vec::new(); { - let add = |arg: &str| { + let mut add = |&mut : arg: &str| { let s = arg.to_c_str(); llvm_args.push(s.as_ptr()); llvm_c_strs.push(s); diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs index c6e4ce9457b..6e6b1c34061 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -748,7 +748,7 @@ fn pick_column_to_specialize(def_map: &DefMap, m: &[Match]) -> Option<uint> { } } - let column_score: |&[Match], uint| -> uint = |m, col| { + let column_score = |&: m: &[Match], col: uint| -> uint { let total_score = m.iter() .map(|row| row.pats[col]) .map(|pat| pat_score(def_map, pat)) diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index fb4ae21478b..47544365426 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -554,7 +554,7 @@ pub fn compare_scalar_types<'blk, 'tcx>(cx: Block<'blk, 'tcx>, t: Ty<'tcx>, op: ast::BinOp) -> Result<'blk, 'tcx> { - let f = |a| Result::new(cx, compare_scalar_values(cx, lhs, rhs, a, op)); + let f = |&: a| Result::new(cx, compare_scalar_values(cx, lhs, rhs, a, op)); match t.sty { ty::ty_tup(ref tys) if tys.is_empty() => f(nil_type), @@ -2749,7 +2749,7 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef { let val = match item { ast_map::NodeItem(i) => { let ty = ty::node_id_to_type(ccx.tcx(), i.id); - let sym = || exported_name(ccx, id, ty, i.attrs[]); + let sym = |&:| exported_name(ccx, id, ty, i.attrs[]); let v = match i.node { ast::ItemStatic(_, _, ref expr) => { @@ -3013,14 +3013,14 @@ fn internalize_symbols(cx: &SharedCrateContext, reachable: &HashSet<String>) { unsafe { let mut declared = HashSet::new(); - let iter_globals = |llmod| { + let iter_globals = |&: llmod| { ValueIter { cur: llvm::LLVMGetFirstGlobal(llmod), step: llvm::LLVMGetNextGlobal, } }; - let iter_functions = |llmod| { + let iter_functions = |&: llmod| { ValueIter { cur: llvm::LLVMGetFirstFunction(llmod), step: llvm::LLVMGetNextFunction, diff --git a/src/librustc_trans/trans/consts.rs b/src/librustc_trans/trans/consts.rs index 1f01da8a124..347ec100ae7 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/trans/consts.rs @@ -305,7 +305,7 @@ pub fn const_expr<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, e: &ast::Expr) // the bool returned is whether this expression can be inlined into other crates // if it's assigned to a static. fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef { - let map_list = |exprs: &[P<ast::Expr>]| { + let map_list = |&: exprs: &[P<ast::Expr>]| { exprs.iter().map(|e| const_expr(cx, &**e).0) .fold(Vec::new(), |mut l, val| { l.push(val); l }) }; diff --git a/src/librustc_trans/trans/debuginfo.rs b/src/librustc_trans/trans/debuginfo.rs index 589250430cd..bce446b7412 100644 --- a/src/librustc_trans/trans/debuginfo.rs +++ b/src/librustc_trans/trans/debuginfo.rs @@ -2489,7 +2489,7 @@ fn prepare_enum_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, }) .collect(); - let discriminant_type_metadata = |inttype| { + let discriminant_type_metadata = |&: inttype| { // We can reuse the type of the discriminant for all monomorphized // instances of an enum because it doesn't depend on any type parameters. // The def_id, uniquely identifying the enum's polytype acts as key in diff --git a/src/librustc_trans/trans/foreign.rs b/src/librustc_trans/trans/foreign.rs index e234d77914b..83765270ef1 100644 --- a/src/librustc_trans/trans/foreign.rs +++ b/src/librustc_trans/trans/foreign.rs @@ -615,7 +615,7 @@ pub fn trans_rust_fn_with_foreign_abi<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, // Array for the arguments we will pass to the rust function. let mut llrust_args = Vec::new(); let mut next_foreign_arg_counter: c_uint = 0; - let next_foreign_arg: |pad: bool| -> c_uint = |pad: bool| { + let mut next_foreign_arg = |&mut : pad: bool| -> c_uint { next_foreign_arg_counter += if pad { 2 } else { diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/trans/intrinsic.rs index d49018e00c1..a22ce297828 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/trans/intrinsic.rs @@ -181,7 +181,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, // This should be caught by the intrinsicck pass assert_eq!(in_type_size, out_type_size); - let nonpointer_nonaggregate = |llkind: TypeKind| -> bool { + let nonpointer_nonaggregate = |&: llkind: TypeKind| -> bool { use llvm::TypeKind::*; match llkind { Half | Float | Double | X86_FP80 | FP128 | diff --git a/src/librustc_trans/trans/monomorphize.rs b/src/librustc_trans/trans/monomorphize.rs index 3b7043e4f40..3166425f3aa 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/trans/monomorphize.rs @@ -139,7 +139,7 @@ pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, // This shouldn't need to option dance. let mut hash_id = Some(hash_id); - let mk_lldecl = |abi: abi::Abi| { + let mut mk_lldecl = |&mut : abi: abi::Abi| { let lldecl = if abi != abi::Rust { foreign::decl_rust_fn_with_foreign_abi(ccx, mono_ty, s[]) } else { @@ -149,7 +149,7 @@ pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ccx.monomorphized().borrow_mut().insert(hash_id.take().unwrap(), lldecl); lldecl }; - let setup_lldecl = |lldecl, attrs: &[ast::Attribute]| { + let setup_lldecl = |&: lldecl, attrs: &[ast::Attribute]| { base::update_linkage(ccx, lldecl, None, base::OriginalTranslation); set_llvm_fn_attrs(ccx, attrs, lldecl); |
