Skip to content

Commit 8b8b861

Browse files
committed
---
yaml --- r: 64425 b: refs/heads/snap-stage3 c: cee5c4a h: refs/heads/master i: 64423: d55029c v: v3
1 parent 6bb597f commit 8b8b861

File tree

16 files changed

+212
-364
lines changed

16 files changed

+212
-364
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 3b158b3e425b8adb42eab076acc9962bb22783ca
4+
refs/heads/snap-stage3: cee5c4ad11d348f0aa6487f5d01c8f660c7f5853
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -639,25 +639,23 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
639639
span: span) {
640640
let cap_vars = this.bccx.capture_map.get(&closure_id);
641641
for cap_vars.iter().advance |cap_var| {
642+
let var_id = ast_util::def_id_of_def(cap_var.def).node;
643+
let var_path = @LpVar(var_id);
644+
this.check_if_path_is_moved(closure_id, span,
645+
MovedInCapture, var_path);
642646
match cap_var.mode {
643-
moves::CapRef | moves::CapCopy => {
644-
let var_id = ast_util::def_id_of_def(cap_var.def).node;
645-
let lp = @LpVar(var_id);
646-
this.check_if_path_is_moved(closure_id, span,
647-
MovedInCapture, lp);
648-
}
647+
moves::CapRef | moves::CapCopy => {}
649648
moves::CapMove => {
650-
check_by_move_capture(this, closure_id, cap_var);
649+
check_by_move_capture(this, closure_id, cap_var, var_path);
651650
}
652651
}
653652
}
654653
return;
655654

656655
fn check_by_move_capture(this: @mut CheckLoanCtxt,
657656
closure_id: ast::node_id,
658-
cap_var: &moves::CaptureVar) {
659-
let var_id = ast_util::def_id_of_def(cap_var.def).node;
660-
let move_path = @LpVar(var_id);
657+
cap_var: &moves::CaptureVar,
658+
move_path: @LoanPath) {
661659
let move_err = this.analyze_move_out_from(closure_id, move_path);
662660
match move_err {
663661
MoveOk => {}

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16121612
llfndecl: ValueRef,
16131613
id: ast::node_id,
16141614
output_type: ty::t,
1615+
skip_retptr: bool,
16151616
param_substs: Option<@param_substs>,
16161617
sp: Option<span>)
16171618
-> fn_ctxt {
@@ -1655,7 +1656,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16551656
fcx.llenv = unsafe {
16561657
llvm::LLVMGetParam(llfndecl, fcx.env_arg_pos() as c_uint)
16571658
};
1658-
if !ty::type_is_nil(substd_output_type) {
1659+
if !ty::type_is_nil(substd_output_type) && !(is_immediate && skip_retptr) {
16591660
fcx.llretptr = Some(make_return_pointer(fcx, substd_output_type));
16601661
}
16611662
fcx
@@ -1667,7 +1668,7 @@ pub fn new_fn_ctxt(ccx: @mut CrateContext,
16671668
output_type: ty::t,
16681669
sp: Option<span>)
16691670
-> fn_ctxt {
1670-
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, sp)
1671+
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, false, None, sp)
16711672
}
16721673

16731674
// NB: must keep 4 fns in sync:
@@ -1861,6 +1862,7 @@ pub fn trans_closure(ccx: @mut CrateContext,
18611862
llfndecl,
18621863
id,
18631864
output_type,
1865+
false,
18641866
param_substs,
18651867
Some(body.span));
18661868
let raw_llargs = create_llargs_for_fn_args(fcx, self_arg, decl.inputs);
@@ -2079,6 +2081,7 @@ pub fn trans_enum_variant_or_tuple_like_struct<A:IdAndTy>(
20792081
llfndecl,
20802082
ctor_id,
20812083
result_ty,
2084+
false,
20822085
param_substs,
20832086
None);
20842087

0 commit comments

Comments
 (0)