Skip to content

Commit e844280

Browse files
committed
---
yaml --- r: 160196 b: refs/heads/snap-stage3 c: 01105ff h: refs/heads/master v: v3
1 parent 501bd7d commit e844280

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: bfaa7bcab3459907014c31d3bf980f65ccd14b08
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4c3ad48c4530e1033d9b74cf8a793e3d87f53c38
4+
refs/heads/snap-stage3: 01105ffde363bff46ebe16d032edb7a538609e18
55
refs/heads/try: 225de0d60f8ca8dcc62ab2fd8818ebbda4b58cfe
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,10 +3545,10 @@ pub fn fn_is_variadic(fty: Ty) -> bool {
35453545
}
35463546
}
35473547

3548-
pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> FnSig<'tcx> {
3548+
pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> &'tcx FnSig<'tcx> {
35493549
match get(fty).sty {
3550-
ty_bare_fn(ref f) => f.sig.clone(),
3551-
ty_closure(ref f) => f.sig.clone(),
3550+
ty_bare_fn(ref f) => &f.sig,
3551+
ty_closure(ref f) => &f.sig,
35523552
ref s => {
35533553
panic!("ty_fn_sig() called on non-fn type: {}", s)
35543554
}
@@ -3565,14 +3565,8 @@ pub fn ty_fn_abi(fty: Ty) -> abi::Abi {
35653565
}
35663566

35673567
// Type accessors for substructures of types
3568-
pub fn ty_fn_args<'tcx>(fty: Ty<'tcx>) -> Vec<Ty<'tcx>> {
3569-
match get(fty).sty {
3570-
ty_bare_fn(ref f) => f.sig.inputs.clone(),
3571-
ty_closure(ref f) => f.sig.inputs.clone(),
3572-
ref s => {
3573-
panic!("ty_fn_args() called on non-fn type: {}", s)
3574-
}
3575-
}
3568+
pub fn ty_fn_args<'tcx>(fty: Ty<'tcx>) -> &'tcx [Ty<'tcx>] {
3569+
ty_fn_sig(fty).inputs.as_slice()
35763570
}
35773571

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

branches/snap-stage3/src/librustc_trans/trans/callee.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,7 @@ pub fn trans_unboxing_shim<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
334334
// Create the substituted versions of the self type.
335335
let arg_scope = fcx.push_custom_cleanup_scope();
336336
let arg_scope_id = cleanup::CustomScope(arg_scope);
337-
let boxed_arg_types = ty::ty_fn_args(boxed_function_type);
338-
let boxed_self_type = boxed_arg_types[0];
337+
let boxed_self_type = ty::ty_fn_args(boxed_function_type)[0];
339338
let arg_types = ty::ty_fn_args(function_type);
340339
let self_type = arg_types[0];
341340
let boxed_self_kind = arg_kind(&fcx, boxed_self_type);
@@ -919,12 +918,11 @@ fn trans_args_under_call_abi<'blk, 'tcx>(
919918
ignore_self: bool)
920919
-> Block<'blk, 'tcx> {
921920
// Translate the `self` argument first.
922-
let arg_tys = ty::ty_fn_args(fn_ty);
923921
if !ignore_self {
924922
let arg_datum = unpack_datum!(bcx, expr::trans(bcx, &*arg_exprs[0]));
925923
llargs.push(unpack_result!(bcx, {
926924
trans_arg_datum(bcx,
927-
arg_tys[0],
925+
ty::ty_fn_args(fn_ty)[0],
928926
arg_datum,
929927
arg_cleanup_scope,
930928
DontAutorefArg)

0 commit comments

Comments
 (0)