Skip to content

Commit 033e5bf

Browse files
committed
---
yaml --- r: 5275 b: refs/heads/master c: 7d69712 h: refs/heads/master i: 5273: 8eb6d33 5271: 3950f0b v: v3
1 parent 8ca35f1 commit 033e5bf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 93d2a4f82a83e05e798eda697e45f66ddb06026b
2+
refs/heads/master: 7d69712deeca330ae20a5ed6764c73608215a3c5

trunk/src/comp/middle/alias.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ fn cant_copy(cx: ctx, b: binding) -> bool {
176176

177177
fn check_call(cx: ctx, f: @ast::expr, args: [@ast::expr]) -> [binding] {
178178
let fty = ty::type_autoderef(cx.tcx, ty::expr_ty(cx.tcx, f));
179+
let ret_ref = ty::ty_fn_ret_style(cx.tcx, fty) == ast::return_ref;
179180
let arg_ts = ty::ty_fn_args(cx.tcx, fty);
180181
let mut_roots: [{arg: uint, node: node_id}] = [];
181182
let bindings = [];
@@ -197,7 +198,7 @@ fn check_call(cx: ctx, f: @ast::expr, args: [@ast::expr]) -> [binding] {
197198
inner_mut(root.ds));
198199
new_bnd.copied = alt arg_t.mode {
199200
ast::by_move. { copied }
200-
ast::by_ref. { not_copied }
201+
ast::by_ref. { ret_ref ? not_allowed : not_copied }
201202
ast::by_mut_ref. { not_allowed }
202203
};
203204
bindings += [new_bnd];

0 commit comments

Comments
 (0)