Skip to content

Commit 95c08e3

Browse files
committed
Skip the pointless tupling/untupling of argument types in trans_closure
The tupling only happens for actual closures, same for the untupling. The only code that actually sees the tupled types is some debugging output for which it is actually rather confusing to have the types tupled, because neither the function signature in Rust nor the function signature for LLVM has them tupled.
1 parent 99ca63f commit 95c08e3

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/librustc_trans/trans/base.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,16 +1578,6 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
15781578
decl.inputs.iter()
15791579
.map(|arg| node_id_type(bcx, arg.id))
15801580
.collect::<Vec<_>>();
1581-
let monomorphized_arg_types = match closure_env {
1582-
closure::ClosureEnv::NotClosure => {
1583-
monomorphized_arg_types
1584-
}
1585-
1586-
// Tuple up closure argument types for the "rust-call" ABI.
1587-
closure::ClosureEnv::Closure(_) => {
1588-
vec![ccx.tcx().mk_tup(monomorphized_arg_types)]
1589-
}
1590-
};
15911581
for monomorphized_arg_type in &monomorphized_arg_types {
15921582
debug!("trans_closure: monomorphized_arg_type: {:?}",
15931583
monomorphized_arg_type);
@@ -1600,8 +1590,7 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
16001590
create_datums_for_fn_args_under_call_abi(bcx, arg_scope, &monomorphized_arg_types[..])
16011591
}
16021592
_ => {
1603-
let arg_tys = untuple_arguments_if_necessary(ccx, &monomorphized_arg_types, abi);
1604-
create_datums_for_fn_args(bcx, &arg_tys)
1593+
create_datums_for_fn_args(bcx, &monomorphized_arg_types)
16051594
}
16061595
};
16071596

0 commit comments

Comments
 (0)