use sources::path::PathSource;
use ops::cargo_rustc;
use ops::cargo_read_manifest::read_manifest;
-// use core::errors::{CargoError,CLIError,CLIResult,ToResult};
-use core::summary::SummaryVec;
-use util::{other_error, CargoError, CargoResult, Wrap};
+use util::{other_error, CargoResult, Wrap};
pub fn compile(manifest_path: &str) -> CargoResult<()> {
let root_dep = try!(read_manifest(manifest_path)).to_dependency();
use std::os::args;
use std::io;
use std::path::Path;
-use core::errors::{CLIError,CLIResult,ToResult};
use core;
use util;
use util::{other_error,CargoResult,CargoError};
let target_dir = pkg.get_absolute_target_dir();
// First ensure that the directory exists
- try!(mk_target(&target_dir).map_err(|err| other_error("could not create target directory")));
+ try!(mk_target(&target_dir).map_err(|_| other_error("could not create target directory")));
// compile
for target in pkg.get_targets().iter() {
impl<T> Wrap for Result<T, CargoError> {
fn wrap(self, desc: &'static str) -> Result<T, CargoError> {
- self
+ match self {
+ Ok(x) => Ok(x),
+ Err(e) => {
+ Err(CargoError {
+ kind: e.kind.clone(),
+ desc: desc,
+ detail: None,
+ cause: Some(box e)
+ })
+ }
+ }
}
}