Skip to content

Commit f93f8db

Browse files
committed
---
yaml --- r: 153051 b: refs/heads/try2 c: df88646 h: refs/heads/master i: 153049: 531f685 153047: 3d079ab v: v3
1 parent e39abf2 commit f93f8db

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: bedc41b257d3d575c00a86c52597e6f1e0fb3e2e
8+
refs/heads/try2: df886468288c78300079bd49b3b6f9f14f5a5617
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/_match.rs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,16 +1255,13 @@ fn compare_values<'a>(
12551255
}
12561256

12571257
fn insert_lllocals<'a>(mut bcx: &'a Block<'a>,
1258-
bindings_map: &BindingsMap,
1259-
cleanup_scope: cleanup::ScopeId)
1258+
bindings_map: &BindingsMap)
12601259
-> &'a Block<'a> {
12611260
/*!
12621261
* For each binding in `data.bindings_map`, adds an appropriate entry into
1263-
* the `fcx.lllocals` map, scheduling cleanup in `cleanup_scope`.
1262+
* the `fcx.lllocals` map
12641263
*/
12651264

1266-
let fcx = bcx.fcx;
1267-
12681265
for (&ident, &binding_info) in bindings_map.iter() {
12691266
let llval = match binding_info.trmode {
12701267
// By value mut binding for a copy type: load from the ptr
@@ -1285,7 +1282,6 @@ fn insert_lllocals<'a>(mut bcx: &'a Block<'a>,
12851282
};
12861283

12871284
let datum = Datum::new(llval, binding_info.ty, Lvalue);
1288-
fcx.schedule_drop_mem(cleanup_scope, llval, binding_info.ty);
12891285

12901286
debug!("binding {:?} to {}",
12911287
binding_info.id,
@@ -1317,21 +1313,11 @@ fn compile_guard<'a, 'b>(
13171313
vec_map_to_str(vals, |v| bcx.val_to_str(*v)));
13181314
let _indenter = indenter();
13191315

1320-
// Lest the guard itself should fail, introduce a temporary cleanup
1321-
// scope for any non-ref bindings we create.
1322-
let temp_scope = bcx.fcx.push_custom_cleanup_scope();
1323-
1324-
let mut bcx = insert_lllocals(bcx, &data.bindings_map,
1325-
cleanup::CustomScope(temp_scope));
1316+
let mut bcx = insert_lllocals(bcx, &data.bindings_map);
13261317

13271318
let val = unpack_datum!(bcx, expr::trans(bcx, guard_expr));
13281319
let val = val.to_llbool(bcx);
13291320

1330-
// Cancel cleanups now that the guard successfully executed. If
1331-
// the guard was false, we will drop the values explicitly
1332-
// below. Otherwise, we'll add lvalue cleanups at the end.
1333-
bcx.fcx.pop_custom_cleanup_scope(temp_scope);
1334-
13351321
return with_cond(bcx, Not(bcx, val), |bcx| {
13361322
// Guard does not match: remove all bindings from the lllocals table
13371323
for (_, &binding_info) in data.bindings_map.iter() {
@@ -1884,12 +1870,9 @@ fn trans_match_inner<'a>(scope_cx: &'a Block<'a>,
18841870
for arm_data in arm_datas.iter() {
18851871
let mut bcx = arm_data.bodycx;
18861872

1887-
// insert bindings into the lllocals map and add cleanups
1888-
let cleanup_scope = fcx.push_custom_cleanup_scope();
1889-
bcx = insert_lllocals(bcx, &arm_data.bindings_map,
1890-
cleanup::CustomScope(cleanup_scope));
1873+
// insert bindings into the lllocals map
1874+
bcx = insert_lllocals(bcx, &arm_data.bindings_map);
18911875
bcx = expr::trans_into(bcx, &*arm_data.arm.body, dest);
1892-
bcx = fcx.pop_and_trans_custom_cleanup_scope(bcx, cleanup_scope);
18931876
arm_cxs.push(bcx);
18941877
}
18951878

0 commit comments

Comments
 (0)