Removing do keyword from librustpkg

This commit is contained in:
Scott Lawrence 2014-01-26 23:12:26 -05:00
parent 518a5e08c0
commit d904179066
3 changed files with 8 additions and 8 deletions

View File

@ -799,14 +799,14 @@ pub fn main_args(args: &[~str]) -> int {
debug!("Will store workcache in {}", ws.display());
// Wrap the rest in task::try in case of a condition failure in a task
let result = do task::try {
let result = task::try(proc() {
BuildContext {
context: context,
sysroot: sysroot.clone(), // Currently, only tests override this
workcache_context: api::default_context(sysroot.clone(),
default_workspace()).workcache_context
}.run(command, args.clone())
};
});
// FIXME #9262: This is using the same error code for all errors,
// and at least one test case succeeds if rustpkg returns COPY_FAILED_CODE,
// when actually, it might set the exit code for that even if a different

View File

@ -607,13 +607,13 @@ fn test_install_invalid() {
let ctxt = fake_ctxt(sysroot, &temp_workspace);
// Uses task::try because of #9001
let result = do task::try {
let result = task::try(proc() {
let pkg_src = PkgSrc::new(temp_workspace.clone(),
temp_workspace.clone(),
false,
crateid.clone());
ctxt.install(pkg_src, &WhatToBuild::new(MaybeCustom, Everything));
};
});
assert!(result.unwrap_err()
.to_str().contains("supplied path for package dir does not exist"));
}

View File

@ -50,7 +50,7 @@ pub fn main() {
prep.declare_input("file",
foo_c_name.as_str().unwrap().to_owned(),
digest_file_with_date(&foo_c_name));
let out_path = do prep.exec |exec| {
let out_path = prep.exec(|exec| {
let out_path = api::build_library_in_workspace(exec,
&mut sub_cx.clone(),
"cdep",
@ -60,7 +60,7 @@ pub fn main() {
"foo");
let out_p = Path::new(out_path.unwrap());
out_p.as_str().unwrap().to_owned()
};
});
out_path
});
let out_lib_path = Path::new(out_lib_path);
@ -68,14 +68,14 @@ pub fn main() {
context.add_library_path(out_lib_path.dir_path());
let context_clone = context.clone();
let task_res = do task::try {
let task_res = task::try(proc() {
let mut cc = context_clone.clone();
api::install_pkg(&mut cc,
os::getcwd(),
~"cdep",
None,
~[(~"binary", out_lib_path.clone()), (~"file", foo_c_name.clone())]);
};
});
if task_res.is_err() {
os::set_exit_status(COPY_FAILED_CODE);