File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 5332250d3bddf509994832965f3c5d7b68662ce4
2
+ refs/heads/master: dcd65fac199d3caac4b1019304ef5e1b480f31ff
Original file line number Diff line number Diff line change @@ -416,6 +416,7 @@ TEST_XFAILS_BOOT := $(TASK_XFAILS) \
416
416
test/run-pass/obj-as.rs \
417
417
test/run-pass/vec-slice.rs \
418
418
test/run-pass/fn-lval.rs \
419
+ test/run-pass/generic-fn-box.rs \
419
420
test/run-pass/generic-recursive-tag.rs \
420
421
test/run-pass/generic-tup.rs \
421
422
test/run-pass/iter-ret.rs \
Original file line number Diff line number Diff line change @@ -3091,6 +3091,12 @@ fn trans_args(@block_ctxt cx,
3091
3091
}
3092
3092
3093
3093
// ... then explicit args.
3094
+
3095
+ // First we figure out the caller's view of the types of the arguments.
3096
+ // This will be needed if this is a generic call, because the callee has
3097
+ // to cast her view of the arguments to the caller's view.
3098
+ auto arg_tys = type_of_explicit_args( cx. fcx. ccx, args) ;
3099
+
3094
3100
auto i = 0 u;
3095
3101
for ( @ast. expr e in es) {
3096
3102
auto mode = args. ( i) . mode;
@@ -3132,9 +3138,9 @@ fn trans_args(@block_ctxt cx,
3132
3138
bcx = re. bcx;
3133
3139
}
3134
3140
3135
- if ( ty. type_has_dynamic_size ( args. ( i) . ty ) ) {
3136
- val = bcx . build . PointerCast ( val ,
3137
- T_typaram_ptr ( cx . fcx . ccx . tn ) ) ;
3141
+ if ( ty. count_ty_params ( args. ( i) . ty) > 0 u ) {
3142
+ auto lldestty = arg_tys . ( i ) ;
3143
+ val = bcx . build . PointerCast ( val , lldestty ) ;
3138
3144
}
3139
3145
3140
3146
llargs += val;
Original file line number Diff line number Diff line change
1
+ fn f[ T ] ( @T x) -> @T {
2
+ ret x;
3
+ }
4
+
5
+ fn main ( ) {
6
+ auto x = f ( @3 ) ;
7
+ log * x;
8
+ }
9
+
You can’t perform that action at this time.
0 commit comments