Skip to content

Commit d80642b

Browse files
committed
auto merge of #6784 : nikomatsakis/rust/moves-into-borrowck, r=pcwalton
Move the computation of what data is moved out of `liveness` and into `borrowck`. The resulting code is cleaner, since before we had a split distribution of responsibilities, and also this avoids having multiple implementations of the dataflow code. Liveness is still used to report warnings about useless writes. This will go away when we get the control-flow graph code landed (working on that). Also adds borrow checker documentation. Fixes #4384. Required to support once fns and to properly fix closures (#2202). First step to generalize our treatment of moves somewhat as well.
2 parents e946b4f + f30b538 commit d80642b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2203
-1363
lines changed

src/librust/rust.rc

+6-6
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ fn cmd_help(args: &[~str]) -> ValidUsage {
152152
}
153153

154154
match args {
155-
[command_string] => print_usage(command_string),
156-
_ => Invalid
155+
[ref command_string] => print_usage(copy *command_string),
156+
_ => Invalid
157157
}
158158
}
159159

160160
fn cmd_test(args: &[~str]) -> ValidUsage {
161161
match args {
162-
[filename] => {
163-
let test_exec = Path(filename).filestem().unwrap() + "test~";
162+
[ref filename] => {
163+
let test_exec = Path(*filename).filestem().unwrap() + "test~";
164164
invoke("rustc", &[~"--test", filename.to_owned(),
165165
~"-o", test_exec.to_owned()], rustc::main);
166166
let exit_code = run::process_status(~"./" + test_exec, []);
@@ -172,8 +172,8 @@ fn cmd_test(args: &[~str]) -> ValidUsage {
172172

173173
fn cmd_run(args: &[~str]) -> ValidUsage {
174174
match args {
175-
[filename, ..prog_args] => {
176-
let exec = Path(filename).filestem().unwrap() + "~";
175+
[ref filename, ..prog_args] => {
176+
let exec = Path(*filename).filestem().unwrap() + "~";
177177
invoke("rustc", &[filename.to_owned(), ~"-o", exec.to_owned()],
178178
rustc::main);
179179
let exit_code = run::process_status(~"./"+exec, prog_args);

src/librustc/driver/driver.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ pub fn compile_rest(sess: Session,
263263
time(time_passes, ~"loop checking", ||
264264
middle::check_loop::check_crate(ty_cx, crate));
265265

266-
let middle::moves::MoveMaps {moves_map, variable_moves_map,
267-
moved_variables_set, capture_map} =
266+
let middle::moves::MoveMaps {moves_map, moved_variables_set,
267+
capture_map} =
268268
time(time_passes, ~"compute moves", ||
269269
middle::moves::compute_moves(ty_cx, method_map, crate));
270270

@@ -274,7 +274,6 @@ pub fn compile_rest(sess: Session,
274274

275275
time(time_passes, ~"liveness checking", ||
276276
middle::liveness::check_crate(ty_cx, method_map,
277-
variable_moves_map,
278277
capture_map, crate));
279278

280279
let (root_map, write_guard_map) =

0 commit comments

Comments
 (0)