Skip to content

Commit c8e55a2

Browse files
committed
---
yaml --- r: 157417 b: refs/heads/try c: 0ee4d8b0b112c608646fa75463ab4dc59132efd9 h: refs/heads/master i: 157415: 220b7d6 v: v3
1 parent 7367eb5 commit c8e55a2

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
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: 065caf34f5ff29e04605f95d9c5d511af219439a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d44ea720fa9dfe062ef06d0eb49a58d4e7e92344
5-
refs/heads/try: ef765f5b1a4f34fcda478139257f9ccb8dfd48d9
5+
refs/heads/try: 0ee4d8b0b112c608646fa75463ab4dc59132efd9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 6601b0501e31d08d3892a2d5a7d8a57ab120bf75

branches/try/src/librustc/middle/trans/callee.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ pub fn trans_unboxing_shim<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
331331
// Create the substituted versions of the self type.
332332
let arg_scope = fcx.push_custom_cleanup_scope();
333333
let arg_scope_id = cleanup::CustomScope(arg_scope);
334-
let boxed_arg_types = ty::ty_fn_args(boxed_function_type);
335-
let boxed_self_type = boxed_arg_types[0];
334+
let boxed_self_type = ty::ty_fn_args(boxed_function_type)[0];
336335
let arg_types = ty::ty_fn_args(function_type);
337336
let self_type = arg_types[0];
338337
let boxed_self_kind = arg_kind(&fcx, boxed_self_type);
@@ -912,12 +911,11 @@ fn trans_args_under_call_abi<'blk, 'tcx>(
912911
ignore_self: bool)
913912
-> Block<'blk, 'tcx> {
914913
// Translate the `self` argument first.
915-
let arg_tys = ty::ty_fn_args(fn_ty);
916914
if !ignore_self {
917915
let arg_datum = unpack_datum!(bcx, expr::trans(bcx, &*arg_exprs[0]));
918916
llargs.push(unpack_result!(bcx, {
919917
trans_arg_datum(bcx,
920-
arg_tys[0],
918+
ty::ty_fn_args(fn_ty)[0],
921919
arg_datum,
922920
arg_cleanup_scope,
923921
DontAutorefArg)

branches/try/src/librustc/middle/ty.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,10 +3328,10 @@ pub fn fn_is_variadic(fty: Ty) -> bool {
33283328
}
33293329
}
33303330

3331-
pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> FnSig<'tcx> {
3331+
pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> &'tcx FnSig<'tcx> {
33323332
match get(fty).sty {
3333-
ty_bare_fn(ref f) => f.sig.clone(),
3334-
ty_closure(ref f) => f.sig.clone(),
3333+
ty_bare_fn(ref f) => &f.sig,
3334+
ty_closure(ref f) => &f.sig,
33353335
ref s => {
33363336
panic!("ty_fn_sig() called on non-fn type: {}", s)
33373337
}
@@ -3348,14 +3348,8 @@ pub fn ty_fn_abi(fty: Ty) -> abi::Abi {
33483348
}
33493349

33503350
// Type accessors for substructures of types
3351-
pub fn ty_fn_args<'tcx>(fty: Ty<'tcx>) -> Vec<Ty<'tcx>> {
3352-
match get(fty).sty {
3353-
ty_bare_fn(ref f) => f.sig.inputs.clone(),
3354-
ty_closure(ref f) => f.sig.inputs.clone(),
3355-
ref s => {
3356-
panic!("ty_fn_args() called on non-fn type: {}", s)
3357-
}
3358-
}
3351+
pub fn ty_fn_args<'tcx>(fty: Ty<'tcx>) -> &'tcx [Ty<'tcx>] {
3352+
ty_fn_sig(fty).inputs.as_slice()
33593353
}
33603354

33613355
pub fn ty_closure_store(fty: Ty) -> TraitStore {

0 commit comments

Comments
 (0)