Skip to content

Commit 2d3262c

Browse files
committed
Update trans to use type to decide when to move, not the moves table (simpler
for cases where it's hard to decide what id to use for the lookup); modify irrefutable bindings code to move or copy depending on the type, rather than threading through a flag. Also updates how local variables and arguments are registered. These changes were hard to isolate.
1 parent 41efcdf commit 2d3262c

File tree

8 files changed

+387
-275
lines changed

8 files changed

+387
-275
lines changed

src/librustc/middle/astencode.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ pub struct Maps {
5353
method_map: middle::typeck::method_map,
5454
vtable_map: middle::typeck::vtable_map,
5555
write_guard_map: middle::borrowck::write_guard_map,
56-
moves_map: middle::moves::MovesMap,
5756
capture_map: middle::moves::CaptureMap,
5857
}
5958

@@ -952,12 +951,6 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
952951
}
953952
}
954953

955-
if maps.moves_map.contains(&id) {
956-
do ebml_w.tag(c::tag_table_moves_map) |ebml_w| {
957-
ebml_w.id(id);
958-
}
959-
}
960-
961954
{
962955
let r = maps.capture_map.find(&id);
963956
for r.iter().advance |&cap_vars| {
@@ -1121,9 +1114,7 @@ fn decode_side_tables(xcx: @ExtendedDecodeContext,
11211114
xcx.dcx.tcx.sess.bug(
11221115
fmt!("unknown tag found in side tables: %x", tag));
11231116
}
1124-
Some(value) => if value == c::tag_table_moves_map {
1125-
dcx.maps.moves_map.insert(id);
1126-
} else {
1117+
Some(value) => {
11271118
let val_doc = entry_doc.get(c::tag_table_val as uint);
11281119
let mut val_dsr = reader::Decoder(val_doc);
11291120
let val_dsr = &mut val_dsr;

src/librustc/middle/const_eval.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ pub fn lookup_const_by_id(tcx: ty::ctxt,
187187
method_map: @mut HashMap::new(),
188188
vtable_map: @mut HashMap::new(),
189189
write_guard_map: @mut HashSet::new(),
190-
moves_map: @mut HashSet::new(),
191190
capture_map: @mut HashMap::new()
192191
};
193192
match csearch::maybe_get_item_ast(tcx, def_id,

0 commit comments

Comments
 (0)