diff --git a/Cargo.lock b/Cargo.lock index d8b7a806664..c761cc25fba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,54 +2,54 @@ name = "cargo" version = "0.1.0" dependencies = [ - "curl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "docopt 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.6.23 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)", - "log 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "registry 0.1.0", - "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "curl-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl-sys" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "docopt" -version = "0.6.21" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "flate2" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "miniz-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -57,22 +57,22 @@ dependencies = [ [[package]] name = "gcc" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "git2" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libgit2-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "glob" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -82,30 +82,30 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#4ae58daf0b3a853ffd [[package]] name = "libgit2-sys" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libssh2-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libssh2-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libressl-pnacl-sys" -version = "2.1.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pnacl-build-helper 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnacl-build-helper 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libssh2-sys" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -113,15 +113,15 @@ name = "libz-sys" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -129,85 +129,85 @@ name = "miniz-sys" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libressl-pnacl-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libressl-pnacl-sys 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pnacl-build-helper" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "registry" version = "0.1.0" dependencies = [ - "curl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-serialize" -version = "0.1.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "semver" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tar" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "term" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "time" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "toml" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "url" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/Cargo.toml b/Cargo.toml index 4587eecb30b..8ff3ffba1f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,18 +15,18 @@ name = "cargo" path = "src/cargo/lib.rs" [dependencies] -toml = "0.1.7" -semver = "0.1.6" -curl = "0.1.3" -tar = "0.1.3" -flate2 = "0.1.0" -git2 = "0.1.0" -glob = "0.1.0" -time = "0.1.0" -log = "0.1.0" -docopt = "0.6.19" -url = "0.2.7" -rustc-serialize = "0.1.5" +toml = "0.1" +semver = "0.1" +curl = "0.1" +tar = "0.1" +flate2 = "0.1" +git2 = "0.1" +glob = "0.1" +time = "0.1" +log = "0.1" +docopt = "0.6" +url = "0.2" +rustc-serialize = "0.2" term = "0.1" [dev-dependencies.hamcrest] diff --git a/src/bin/bench.rs b/src/bin/bench.rs index ac591a677b2..560df512c1d 100644 --- a/src/bin/bench.rs +++ b/src/bin/bench.rs @@ -5,7 +5,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError, Human}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_no_run: bool, flag_package: Option, diff --git a/src/bin/build.rs b/src/bin/build.rs index aafd93bff90..c23c323b011 100644 --- a/src/bin/build.rs +++ b/src/bin/build.rs @@ -6,7 +6,7 @@ use cargo::ops; use cargo::util::important_paths::{find_root_manifest_for_cwd}; use cargo::util::{CliResult, CliError}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_package: Option, flag_jobs: Option, diff --git a/src/bin/cargo.rs b/src/bin/cargo.rs index 95a160fd85e..149be5123b2 100644 --- a/src/bin/cargo.rs +++ b/src/bin/cargo.rs @@ -1,4 +1,4 @@ -#![feature(phase, macro_rules)] +#![feature(phase, macro_rules, old_orphan_check)] extern crate "rustc-serialize" as rustc_serialize; #[phase(plugin, link)] extern crate log; @@ -7,14 +7,14 @@ extern crate "rustc-serialize" as rustc_serialize; use std::collections::BTreeSet; use std::os; use std::io; -use std::io::fs::{mod, PathExtensions}; +use std::io::fs::{self, PathExtensions}; use std::io::process::{Command,InheritFd,ExitStatus,ExitSignal}; use cargo::{execute_main_without_stdin, handle_error, shell}; use cargo::core::MultiShell; use cargo::util::{CliError, CliResult, lev_distance}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Flags { flag_list: bool, flag_verbose: bool, diff --git a/src/bin/clean.rs b/src/bin/clean.rs index 56c9cfcb848..d5046d3560e 100644 --- a/src/bin/clean.rs +++ b/src/bin/clean.rs @@ -5,7 +5,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_package: Option, flag_target: Option, diff --git a/src/bin/config_for_key.rs b/src/bin/config_for_key.rs index 03ee0721076..1602ea1216f 100644 --- a/src/bin/config_for_key.rs +++ b/src/bin/config_for_key.rs @@ -4,13 +4,13 @@ use std::collections::HashMap; use cargo::core::MultiShell; use cargo::util::{CliResult, CliError, config}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct ConfigForKeyFlags { flag_human: bool, flag_key: String, } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] struct ConfigOut { values: HashMap } diff --git a/src/bin/config_list.rs b/src/bin/config_list.rs index e7659f51a8b..0fdf7e670e3 100644 --- a/src/bin/config_list.rs +++ b/src/bin/config_list.rs @@ -4,12 +4,12 @@ use std::collections::HashMap; use cargo::core::MultiShell; use cargo::util::{CliResult, CliError, config}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct ConfigListFlags { flag_human: bool, } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] struct ConfigOut { values: HashMap } diff --git a/src/bin/doc.rs b/src/bin/doc.rs index 28c27338080..daf8e312291 100644 --- a/src/bin/doc.rs +++ b/src/bin/doc.rs @@ -3,7 +3,7 @@ use cargo::core::{MultiShell}; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_features: Vec, flag_jobs: Option, diff --git a/src/bin/fetch.rs b/src/bin/fetch.rs index 96adca0ba16..98e33f3b492 100644 --- a/src/bin/fetch.rs +++ b/src/bin/fetch.rs @@ -3,7 +3,7 @@ use cargo::core::{MultiShell}; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::find_root_manifest_for_cwd; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_manifest_path: Option, flag_verbose: bool, diff --git a/src/bin/generate_lockfile.rs b/src/bin/generate_lockfile.rs index cc442603874..e1fe72e3fbb 100644 --- a/src/bin/generate_lockfile.rs +++ b/src/bin/generate_lockfile.rs @@ -5,7 +5,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::find_root_manifest_for_cwd; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_manifest_path: Option, flag_verbose: bool, diff --git a/src/bin/git_checkout.rs b/src/bin/git_checkout.rs index 8e2712cdcf6..1a19a3423d3 100644 --- a/src/bin/git_checkout.rs +++ b/src/bin/git_checkout.rs @@ -3,7 +3,7 @@ use cargo::core::source::{Source, SourceId, GitReference}; use cargo::sources::git::{GitSource}; use cargo::util::{Config, CliResult, CliError, human, ToUrl}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_url: String, flag_reference: String, diff --git a/src/bin/help.rs b/src/bin/help.rs index d57415b5b19..c21dbefebef 100644 --- a/src/bin/help.rs +++ b/src/bin/help.rs @@ -1,7 +1,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options; pub const USAGE: &'static str = " diff --git a/src/bin/locate_project.rs b/src/bin/locate_project.rs index 9162a7edb73..0644cb8649e 100644 --- a/src/bin/locate_project.rs +++ b/src/bin/locate_project.rs @@ -2,7 +2,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError, human, ChainError}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct LocateProjectFlags { flag_manifest_path: Option, } @@ -16,7 +16,7 @@ Options: -h, --help Print this message "; -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] struct ProjectLocation { root: String } diff --git a/src/bin/login.rs b/src/bin/login.rs index 0310f9086ae..9b00c650897 100644 --- a/src/bin/login.rs +++ b/src/bin/login.rs @@ -5,7 +5,7 @@ use cargo::core::{MultiShell, SourceId, Source}; use cargo::sources::RegistrySource; use cargo::util::{CliResult, CliError, Config}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_host: Option, arg_token: Option, diff --git a/src/bin/new.rs b/src/bin/new.rs index 80f6c5999f9..2fa346c6125 100644 --- a/src/bin/new.rs +++ b/src/bin/new.rs @@ -4,7 +4,7 @@ use cargo::ops; use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_verbose: bool, flag_bin: bool, diff --git a/src/bin/owner.rs b/src/bin/owner.rs index a4cf36f6564..b0bfcc3f679 100644 --- a/src/bin/owner.rs +++ b/src/bin/owner.rs @@ -2,7 +2,7 @@ use cargo::ops; use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { arg_crate: Option, flag_token: Option, diff --git a/src/bin/package.rs b/src/bin/package.rs index dbc91e42c6e..bf8f1a01cd3 100644 --- a/src/bin/package.rs +++ b/src/bin/package.rs @@ -3,7 +3,7 @@ use cargo::core::{MultiShell}; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::find_root_manifest_for_cwd; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_verbose: bool, flag_manifest_path: Option, diff --git a/src/bin/pkgid.rs b/src/bin/pkgid.rs index 8cb91e0ae4b..53f09b099cf 100644 --- a/src/bin/pkgid.rs +++ b/src/bin/pkgid.rs @@ -3,7 +3,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_verbose: bool, flag_manifest_path: Option, diff --git a/src/bin/publish.rs b/src/bin/publish.rs index 07e1625de4b..14327230600 100644 --- a/src/bin/publish.rs +++ b/src/bin/publish.rs @@ -3,7 +3,7 @@ use cargo::core::{MultiShell}; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::find_root_manifest_for_cwd; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_host: Option, flag_token: Option, diff --git a/src/bin/read_manifest.rs b/src/bin/read_manifest.rs index 03a85f850c3..fe8d88be045 100644 --- a/src/bin/read_manifest.rs +++ b/src/bin/read_manifest.rs @@ -2,7 +2,7 @@ use cargo::core::{MultiShell, Package, Source}; use cargo::util::{CliResult, CliError}; use cargo::sources::{PathSource}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_manifest_path: String, } diff --git a/src/bin/run.rs b/src/bin/run.rs index 9883e5c044a..473d847bdea 100644 --- a/src/bin/run.rs +++ b/src/bin/run.rs @@ -6,7 +6,7 @@ use cargo::core::manifest::TargetKind; use cargo::util::{CliResult, CliError, human}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_bin: Option, flag_example: Option, diff --git a/src/bin/search.rs b/src/bin/search.rs index 706100112ae..a973d14f653 100644 --- a/src/bin/search.rs +++ b/src/bin/search.rs @@ -2,7 +2,7 @@ use cargo::ops; use cargo::core::{MultiShell}; use cargo::util::{CliResult, CliError}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { flag_host: Option, flag_verbose: bool, diff --git a/src/bin/test.rs b/src/bin/test.rs index 26a3346dc0f..b22b01e0087 100644 --- a/src/bin/test.rs +++ b/src/bin/test.rs @@ -5,7 +5,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError, Human}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { arg_args: Vec, flag_features: Vec, diff --git a/src/bin/update.rs b/src/bin/update.rs index 47596ba74a1..1e3dec520e0 100644 --- a/src/bin/update.rs +++ b/src/bin/update.rs @@ -5,7 +5,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::find_root_manifest_for_cwd; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { arg_spec: Option, flag_package: Option, diff --git a/src/bin/verify_project.rs b/src/bin/verify_project.rs index 4bd04adfa57..5445bc91958 100644 --- a/src/bin/verify_project.rs +++ b/src/bin/verify_project.rs @@ -9,7 +9,7 @@ use cargo::util::CliResult; pub type Error = HashMap; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Flags { flag_manifest_path: String, flag_verbose: bool, diff --git a/src/bin/version.rs b/src/bin/version.rs index 02fcb0cff9d..1f9212e574a 100644 --- a/src/bin/version.rs +++ b/src/bin/version.rs @@ -4,7 +4,7 @@ use cargo; use cargo::core::MultiShell; use cargo::util::CliResult; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options; pub const USAGE: &'static str = " diff --git a/src/bin/yank.rs b/src/bin/yank.rs index 2103f69c828..a0e78907215 100644 --- a/src/bin/yank.rs +++ b/src/bin/yank.rs @@ -3,7 +3,7 @@ use cargo::core::MultiShell; use cargo::util::{CliResult, CliError}; use cargo::util::important_paths::find_root_manifest_for_cwd; -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct Options { arg_crate: Option, flag_token: Option, diff --git a/src/cargo/core/dependency.rs b/src/cargo/core/dependency.rs index 76e9f97c6fc..a26e7eace1e 100644 --- a/src/cargo/core/dependency.rs +++ b/src/cargo/core/dependency.rs @@ -4,7 +4,7 @@ use core::{SourceId, Summary, PackageId}; use util::CargoResult; /// Informations about a dependency requested by a Cargo manifest. -#[deriving(PartialEq,Clone,Show)] +#[derive(PartialEq,Clone,Show)] pub struct Dependency { name: String, source_id: SourceId, @@ -22,7 +22,7 @@ pub struct Dependency { only_for_platform: Option, } -#[deriving(PartialEq, Clone, Show, Copy)] +#[derive(PartialEq, Clone, Show, Copy)] pub enum Kind { Normal, Development, @@ -184,7 +184,7 @@ impl Dependency { } } -#[deriving(PartialEq,Clone,RustcEncodable)] +#[derive(PartialEq,Clone,RustcEncodable)] pub struct SerializedDependency { name: String, req: String diff --git a/src/cargo/core/manifest.rs b/src/cargo/core/manifest.rs index 2953001a73e..48b7a7f55e4 100644 --- a/src/cargo/core/manifest.rs +++ b/src/cargo/core/manifest.rs @@ -1,5 +1,5 @@ use std::hash; -use std::fmt::{mod, Show, Formatter}; +use std::fmt::{self, Show, Formatter}; use semver::Version; use rustc_serialize::{Encoder,Encodable}; @@ -10,7 +10,7 @@ use core::dependency::SerializedDependency; use util::{CargoResult, human}; /// Contains all the informations about a package, as loaded from a Cargo.toml. -#[deriving(PartialEq,Clone)] +#[derive(PartialEq,Clone)] pub struct Manifest { summary: Summary, targets: Vec, @@ -40,7 +40,7 @@ impl Show for Manifest { /// validated by cargo itself, but rather it is up to the registry when uploaded /// to validate these fields. Cargo will itself accept any valid TOML /// specification for these values. -#[deriving(PartialEq, Clone)] +#[derive(PartialEq, Clone)] pub struct ManifestMetadata { pub authors: Vec, pub keywords: Vec, @@ -53,7 +53,7 @@ pub struct ManifestMetadata { pub documentation: Option, // url } -#[deriving(PartialEq,Clone,RustcEncodable)] +#[derive(PartialEq,Clone,RustcEncodable)] pub struct SerializedManifest { name: String, version: String, @@ -81,7 +81,7 @@ impl> Encodable for Manifest { } } -#[deriving(Show, Clone, PartialEq, Hash, RustcEncodable, Copy)] +#[derive(Show, Clone, PartialEq, Hash, RustcEncodable, Copy)] pub enum LibKind { Lib, Rlib, @@ -116,14 +116,14 @@ impl LibKind { } } -#[deriving(Show, Clone, Hash, PartialEq, RustcEncodable)] +#[derive(Show, Clone, Hash, PartialEq, RustcEncodable)] pub enum TargetKind { Lib(Vec), Bin, Example, } -#[deriving(RustcEncodable, RustcDecodable, Clone, PartialEq, Show)] +#[derive(RustcEncodable, RustcDecodable, Clone, PartialEq, Show)] pub struct Profile { env: String, // compile, test, dev, bench, etc. opt_level: uint, @@ -351,7 +351,7 @@ impl hash::Hash for Profile { } /// Informations about a binary, a library, an example, etc. that is part of the package. -#[deriving(Clone, Hash, PartialEq)] +#[derive(Clone, Hash, PartialEq)] pub struct Target { kind: TargetKind, name: String, @@ -360,7 +360,7 @@ pub struct Target { metadata: Option, } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] pub struct SerializedTarget { kind: Vec<&'static str>, name: String, diff --git a/src/cargo/core/package.rs b/src/cargo/core/package.rs index 75f73e52c30..794ccd3d354 100644 --- a/src/cargo/core/package.rs +++ b/src/cargo/core/package.rs @@ -1,4 +1,4 @@ -use std::fmt::{mod, Show, Formatter}; +use std::fmt::{self, Show, Formatter}; use std::hash; use std::slice; use semver::Version; @@ -20,7 +20,7 @@ use core::source::{SourceId, Source}; /// /// A package is a `Cargo.toml` file, plus all the files that are part of it. // TODO: Is manifest_path a relic? -#[deriving(Clone)] +#[derive(Clone)] pub struct Package { // The package's manifest manifest: Manifest, @@ -30,7 +30,7 @@ pub struct Package { source_id: SourceId, } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] struct SerializedPackage { name: String, version: String, @@ -137,7 +137,7 @@ impl hash::Hash for Package { } } -#[deriving(PartialEq,Clone,Show)] +#[derive(PartialEq,Clone,Show)] pub struct PackageSet { packages: Vec, } diff --git a/src/cargo/core/package_id.rs b/src/cargo/core/package_id.rs index 80aa1f694f7..a3db63d48d0 100644 --- a/src/cargo/core/package_id.rs +++ b/src/cargo/core/package_id.rs @@ -1,23 +1,24 @@ -use semver; +use std::cmp::Ordering; use std::error::{Error, FromError}; +use std::fmt::{self, Show, Formatter}; use std::hash::Hash; -use std::sync::Arc; -use std::fmt::{mod, Show, Formatter}; use std::hash; -use rustc_serialize::{Encodable, Encoder, Decodable, Decoder}; +use std::sync::Arc; use regex::Regex; +use rustc_serialize::{Encodable, Encoder, Decodable, Decoder}; +use semver; use util::{CargoResult, CargoError, short_hash, ToSemver}; use core::source::SourceId; /// Identifier for a specific version of a package in a specific source. -#[deriving(Clone)] +#[derive(Clone)] pub struct PackageId { inner: Arc, } -#[deriving(PartialEq, PartialOrd, Eq, Ord)] +#[derive(PartialEq, PartialOrd, Eq, Ord)] struct PackageIdInner { name: String, version: semver::Version, @@ -80,7 +81,7 @@ impl Ord for PackageId { } } -#[deriving(Clone, Show, PartialEq)] +#[derive(Clone, Show, PartialEq)] pub enum PackageIdError { InvalidVersion(String), InvalidNamespace(String) @@ -108,7 +109,7 @@ impl FromError for Box { fn from_error(t: PackageIdError) -> Box { box t } } -#[deriving(PartialEq, Hash, Clone, RustcEncodable)] +#[derive(PartialEq, Hash, Clone, RustcEncodable)] pub struct Metadata { pub metadata: String, pub extra_filename: String diff --git a/src/cargo/core/package_id_spec.rs b/src/cargo/core/package_id_spec.rs index 8bc5ae446d6..dce16d30c5e 100644 --- a/src/cargo/core/package_id_spec.rs +++ b/src/cargo/core/package_id_spec.rs @@ -1,11 +1,11 @@ use std::fmt; use semver::Version; -use url::{mod, Url, UrlParser}; +use url::{self, Url, UrlParser}; use core::PackageId; use util::{CargoResult, ToUrl, human, ToSemver, ChainError}; -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub struct PackageIdSpec { name: String, version: Option, diff --git a/src/cargo/core/registry.rs b/src/cargo/core/registry.rs index 4bda4840824..dfa9aa1161f 100644 --- a/src/cargo/core/registry.rs +++ b/src/cargo/core/registry.rs @@ -64,7 +64,7 @@ pub struct PackageRegistry<'a> { locked: HashMap)>>>, } -#[deriving(PartialEq, Eq, Copy)] +#[derive(PartialEq, Eq, Copy)] enum Kind { Override, Locked, @@ -152,13 +152,15 @@ impl<'a> PackageRegistry<'a> { } pub fn register_lock(&mut self, id: PackageId, deps: Vec) { - let sub_map = match self.locked.entry(id.get_source_id().clone()) { + let source = id.get_source_id().clone(); + let sub_map = match self.locked.entry(&source) { Occupied(e) => e.into_mut(), - Vacant(e) => e.set(HashMap::new()), + Vacant(e) => e.insert(HashMap::new()), }; - let sub_vec = match sub_map.entry(id.get_name().to_string()) { + let name = id.get_name().to_string(); + let sub_vec = match sub_map.entry(&name) { Occupied(e) => e.into_mut(), - Vacant(e) => e.set(Vec::new()), + Vacant(e) => e.insert(Vec::new()), }; sub_vec.push((id, deps)); } diff --git a/src/cargo/core/resolver/encode.rs b/src/cargo/core/resolver/encode.rs index a469ed2b2f3..baae96b956a 100644 --- a/src/cargo/core/resolver/encode.rs +++ b/src/cargo/core/resolver/encode.rs @@ -8,7 +8,7 @@ use util::{CargoResult, Graph}; use super::Resolve; -#[deriving(RustcEncodable, RustcDecodable, Show)] +#[derive(RustcEncodable, RustcDecodable, Show)] pub struct EncodableResolve { package: Option>, root: EncodableDependency, @@ -76,7 +76,7 @@ impl EncodableResolve { } } -#[deriving(RustcEncodable, RustcDecodable, Show, PartialOrd, Ord, PartialEq, Eq)] +#[derive(RustcEncodable, RustcDecodable, Show, PartialOrd, Ord, PartialEq, Eq)] pub struct EncodableDependency { name: String, version: String, @@ -93,7 +93,7 @@ impl EncodableDependency { } } -#[deriving(Show, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Show, PartialOrd, Ord, PartialEq, Eq)] pub struct EncodablePackageId { name: String, version: String, diff --git a/src/cargo/core/resolver/mod.rs b/src/cargo/core/resolver/mod.rs index 1a1f9423c13..09e2fca382d 100644 --- a/src/cargo/core/resolver/mod.rs +++ b/src/cargo/core/resolver/mod.rs @@ -22,7 +22,7 @@ mod encode; /// /// Each instance of `Resolve` also understands the full set of features used /// for each package as well as what the root package is. -#[deriving(PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone)] pub struct Resolve { graph: Graph, features: HashMap>, @@ -30,7 +30,7 @@ pub struct Resolve { metadata: Option, } -#[deriving(Copy)] +#[derive(Copy)] pub enum Method<'a> { Everything, Required(/* dev_deps = */ bool, @@ -92,11 +92,10 @@ impl Resolve { spec: &PackageIdSpec) { let mut version_cnt = HashMap::new(); for id in ids.iter() { - let slot = match version_cnt.entry(id.get_version()) { - Occupied(e) => e.into_mut(), - Vacant(e) => e.set(0u), - }; - *slot += 1; + match version_cnt.entry(&id.get_version()) { + Vacant(e) => { e.insert(1u); } + Occupied(e) => *e.into_mut() += 1u, + } } for id in ids.iter() { if version_cnt[id.get_version()] == 1 { @@ -122,7 +121,7 @@ impl fmt::Show for Resolve { } } -#[deriving(Clone)] +#[derive(Clone)] struct Context { activations: HashMap<(String, SourceId), Vec>>, resolve: Resolve, @@ -241,9 +240,9 @@ fn activate_deps<'a, R: Registry>(cx: Context, let early_return = { my_cx.resolve.graph.link(parent.get_package_id().clone(), candidate.get_package_id().clone()); - let prev = match my_cx.activations.entry(key.clone()) { + let prev = match my_cx.activations.entry(&key) { Occupied(e) => e.into_mut(), - Vacant(e) => e.set(Vec::new()), + Vacant(e) => e.insert(Vec::new()), }; if prev.iter().any(|c| c == candidate) { match cx.resolve.features(candidate.get_package_id()) { @@ -408,10 +407,10 @@ fn resolve_features<'a>(cx: &mut Context, parent: &'a Summary, // Record what list of features is active for this package. if used_features.len() > 0 { - let pkgid = parent.get_package_id().clone(); + let pkgid = parent.get_package_id(); match cx.resolve.features.entry(pkgid) { Occupied(entry) => entry.into_mut(), - Vacant(entry) => entry.set(HashSet::new()), + Vacant(entry) => entry.insert(HashSet::new()), }.extend(used_features.into_iter()); } @@ -478,9 +477,9 @@ fn build_features(s: &Summary, method: Method) match parts.next() { Some(feat) => { let package = feat_or_package; - match deps.entry(package.to_string()) { + match deps.entry(package) { Occupied(e) => e.into_mut(), - Vacant(e) => e.set(Vec::new()), + Vacant(e) => e.insert(Vec::new()), }.push(feat.to_string()); } None => { @@ -499,9 +498,9 @@ fn build_features(s: &Summary, method: Method) } } None => { - match deps.entry(feat.to_string()) { + match deps.entry(feat) { Occupied(..) => {} // already activated - Vacant(e) => { e.set(Vec::new()); } + Vacant(e) => { e.insert(Vec::new()); } } } } diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 10965255519..8d25db75ebe 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -6,7 +6,7 @@ use std::fmt::Show; use self::AdequateTerminal::{NoColor, Colored}; -#[deriving(Copy)] +#[derive(Copy)] pub struct ShellConfig { pub color: bool, pub verbose: bool, diff --git a/src/cargo/core/source.rs b/src/cargo/core/source.rs index 36b9ae2862d..de7b3ea6494 100644 --- a/src/cargo/core/source.rs +++ b/src/cargo/core/source.rs @@ -1,5 +1,6 @@ use std::collections::hash_map::{HashMap, Values, IterMut}; -use std::fmt::{mod, Show, Formatter}; +use std::cmp::Ordering; +use std::fmt::{self, Show, Formatter}; use std::hash; use std::mem; use std::sync::Arc; @@ -42,7 +43,7 @@ pub trait Source: Registry { fn fingerprint(&self, pkg: &Package) -> CargoResult; } -#[deriving(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] enum Kind { /// Kind::Git() represents a git repository Git(GitReference), @@ -52,7 +53,7 @@ enum Kind { Registry, } -#[deriving(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum GitReference { Tag(String), Branch(String), @@ -62,12 +63,12 @@ pub enum GitReference { type Error = Box; /// Unique identifier for a source of packages. -#[deriving(Clone, Eq)] +#[derive(Clone, Eq)] pub struct SourceId { inner: Arc, } -#[deriving(Eq, Clone)] +#[derive(Eq, Clone)] struct SourceIdInner { url: Url, kind: Kind, @@ -406,9 +407,8 @@ impl<'src> SourceMap<'src> { } } -impl<'a, 'src> Iterator<(&'a SourceId, &'a mut (Source + 'src))> - for SourcesMut<'a, 'src> -{ +impl<'a, 'src> Iterator for SourcesMut<'a, 'src> { + type Item = (&'a SourceId, &'a mut (Source + 'src)); fn next(&mut self) -> Option<(&'a SourceId, &'a mut (Source + 'src))> { self.inner.next().map(|(a, b)| (a, &mut **b)) } diff --git a/src/cargo/core/summary.rs b/src/cargo/core/summary.rs index f750e00806f..e73ae60c7fe 100644 --- a/src/cargo/core/summary.rs +++ b/src/cargo/core/summary.rs @@ -10,7 +10,7 @@ use util::{CargoResult, human}; /// a package. /// /// Summaries are cloned, and should not be mutated after creation -#[deriving(Show,Clone)] +#[derive(Show,Clone)] pub struct Summary { package_id: PackageId, dependencies: Vec, diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs index d20f5dcf287..799c9e7b041 100644 --- a/src/cargo/lib.rs +++ b/src/cargo/lib.rs @@ -2,7 +2,7 @@ #![crate_type="rlib"] #![feature(macro_rules, phase, default_type_params, unboxed_closures)] -#![feature(slicing_syntax)] +#![feature(slicing_syntax, old_orphan_check, associated_types)] #![deny(unused)] #![cfg_attr(test, deny(warnings))] @@ -26,12 +26,13 @@ extern crate url; extern crate registry; -use std::os; use std::error::Error; +use std::fmt; use std::io::stdio::{stdout_raw, stderr_raw}; -use std::io::{mod, stdout, stderr}; +use std::io::{self, stdout, stderr}; +use std::os; use rustc_serialize::{Decoder, Encoder, Decodable, Encodable}; -use rustc_serialize::json; +use rustc_serialize::json::{self, Json}; use docopt::Docopt; use core::{Shell, MultiShell, ShellConfig}; @@ -64,48 +65,52 @@ pub mod util; pub trait RepresentsJSON : Decodable {} impl> RepresentsJSON for T {} -pub fn execute_main<'a, - T: Decodable, - U: RepresentsJSON, - V: Encodable, io::IoError>>( +pub fn execute_main( exec: fn(T, U, &mut MultiShell) -> CliResult>, options_first: bool, - usage: &str) { + usage: &str) + where V: for<'a> Encodable, fmt::Error>, + T: Decodable, + U: RepresentsJSON +{ process::(|rest, shell| call_main(exec, shell, usage, rest, options_first)); } -pub fn call_main<'a, - T: Decodable, - U: RepresentsJSON, - V: Encodable, io::IoError>>( +pub fn call_main( exec: fn(T, U, &mut MultiShell) -> CliResult>, shell: &mut MultiShell, usage: &str, args: &[String], - options_first: bool) -> CliResult> { + options_first: bool) -> CliResult> + where V: for<'a> Encodable, fmt::Error>, + T: Decodable, + U: RepresentsJSON +{ let flags = try!(flags_from_args::(usage, args, options_first)); let json = try!(json_from_stdin::()); exec(flags, json, shell) } -pub fn execute_main_without_stdin<'a, - T: Decodable, - V: Encodable, io::IoError>>( +pub fn execute_main_without_stdin( exec: fn(T, &mut MultiShell) -> CliResult>, options_first: bool, - usage: &str) { + usage: &str) + where V: for<'a> Encodable, fmt::Error>, + T: Decodable +{ process::(|rest, shell| call_main_without_stdin(exec, shell, usage, rest, options_first)); } -pub fn execute_main_with_args_and_without_stdin<'a, - T: Decodable, - V: Encodable, io::IoError>>( +pub fn execute_main_with_args_and_without_stdin( exec: fn(T, &mut MultiShell) -> CliResult>, options_first: bool, usage: &str, - args: &[String]) { + args: &[String]) + where V: for<'a> Encodable, fmt::Error>, + T: Decodable +{ let mut shell = shell(true); process_executed( @@ -113,28 +118,30 @@ pub fn execute_main_with_args_and_without_stdin<'a, &mut shell) } -pub fn call_main_without_stdin<'a, - T: Decodable, - V: Encodable, io::IoError>>( +pub fn call_main_without_stdin( exec: fn(T, &mut MultiShell) -> CliResult>, shell: &mut MultiShell, usage: &str, args: &[String], - options_first: bool) -> CliResult> { + options_first: bool) -> CliResult> + where V: for<'a> Encodable, fmt::Error>, + T: Decodable +{ let flags = try!(flags_from_args::(usage, args, options_first)); exec(flags, shell) } -fn process<'a, V: Encodable, io::IoError>>( - callback: |&[String], &mut MultiShell| -> CliResult>) { +fn process(callback: |&[String], &mut MultiShell| -> CliResult>) + where V: for<'a> Encodable, fmt::Error> +{ let mut shell = shell(true); process_executed(callback(os::args().as_slice(), &mut shell), &mut shell) } -pub fn process_executed<'a, - T: Encodable, io::IoError>>( - result: CliResult>, - shell: &mut MultiShell) { +pub fn process_executed(result: CliResult>, + shell: &mut MultiShell) + where T: for<'a> Encodable, fmt::Error> +{ match result { Err(e) => handle_error(e, shell), Ok(Some(encodable)) => { @@ -280,7 +287,7 @@ fn json_from_stdin() -> CliResult { CliError::new("Standard in did not exist or was not UTF-8", 1) })); - let json = try!(json::from_str(input.as_slice()).map_err(|_| { + let json = try!(Json::from_str(input.as_slice()).map_err(|_| { CliError::new("Could not parse standard in as JSON", 1) })); let mut decoder = json::Decoder::new(json); diff --git a/src/cargo/ops/cargo_clean.rs b/src/cargo/ops/cargo_clean.rs index c9b117b97d2..45f1d4d172a 100644 --- a/src/cargo/ops/cargo_clean.rs +++ b/src/cargo/ops/cargo_clean.rs @@ -1,11 +1,11 @@ use std::default::Default; -use std::io::fs::{mod, PathExtensions}; +use std::io::fs::{self, PathExtensions}; use core::{MultiShell, PackageSet}; use core::source::{Source, SourceMap}; use sources::PathSource; use util::{CargoResult, human, ChainError, Config}; -use ops::{mod, Layout, Context}; +use ops::{self, Layout, Context}; pub struct CleanOptions<'a> { pub spec: Option<&'a str>, diff --git a/src/cargo/ops/cargo_compile.rs b/src/cargo/ops/cargo_compile.rs index 1646b651755..2c91141cd14 100644 --- a/src/cargo/ops/cargo_compile.rs +++ b/src/cargo/ops/cargo_compile.rs @@ -30,7 +30,7 @@ use std::sync::Arc; use core::registry::PackageRegistry; use core::{MultiShell, Source, SourceId, PackageSet, Package, Target, PackageId}; use core::resolver::Method; -use ops::{mod, BuildOutput, ExecEngine}; +use ops::{self, BuildOutput, ExecEngine}; use sources::{PathSource}; use util::config::{Config, ConfigValue}; use util::{CargoResult, config, internal, human, ChainError, profile}; diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index 1fa52c7d1e6..de3e83ca1c9 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -1,5 +1,5 @@ use std::os; -use std::io::{mod, fs, File}; +use std::io::{self, fs, File}; use std::io::fs::PathExtensions; use git2::Config; diff --git a/src/cargo/ops/cargo_read_manifest.rs b/src/cargo/ops/cargo_read_manifest.rs index 9e78c4f9d1d..02ff5999be3 100644 --- a/src/cargo/ops/cargo_read_manifest.rs +++ b/src/cargo/ops/cargo_read_manifest.rs @@ -1,9 +1,9 @@ use std::collections::HashSet; -use std::io::{mod, File, fs}; +use std::io::{self, File, fs}; use std::io::fs::PathExtensions; use core::{Package,Manifest,SourceId}; -use util::{mod, CargoResult, human}; +use util::{self, CargoResult, human}; use util::important_paths::find_project_manifest_exact; use util::toml::{Layout, project_layout}; use std::error::FromError; diff --git a/src/cargo/ops/cargo_run.rs b/src/cargo/ops/cargo_run.rs index 6293ec800bb..706a74fa79f 100644 --- a/src/cargo/ops/cargo_run.rs +++ b/src/cargo/ops/cargo_run.rs @@ -1,6 +1,6 @@ use std::os; -use ops::{mod, ExecEngine}; +use ops::{self, ExecEngine}; use util::{CargoResult, human, process, ProcessError, ChainError}; use core::manifest::TargetKind; use core::source::Source; diff --git a/src/cargo/ops/cargo_rustc/compilation.rs b/src/cargo/ops/cargo_rustc/compilation.rs index fce3bdcbc22..c8313964f7f 100644 --- a/src/cargo/ops/cargo_rustc/compilation.rs +++ b/src/cargo/ops/cargo_rustc/compilation.rs @@ -1,9 +1,10 @@ use std::collections::HashMap; +use std::c_str::ToCStr; use std::dynamic_lib::DynamicLibrary; use semver::Version; use core::{PackageId, Package}; -use util::{mod, CargoResult}; +use util::{self, CargoResult}; use super::{CommandType, CommandPrototype}; diff --git a/src/cargo/ops/cargo_rustc/context.rs b/src/cargo/ops/cargo_rustc/context.rs index 1a45a0911f9..a76de7fece2 100644 --- a/src/cargo/ops/cargo_rustc/context.rs +++ b/src/cargo/ops/cargo_rustc/context.rs @@ -4,7 +4,7 @@ use std::str; use std::sync::Arc; use core::{SourceMap, Package, PackageId, PackageSet, Resolve, Target}; -use util::{mod, CargoResult, ChainError, internal, Config, profile}; +use util::{self, CargoResult, ChainError, internal, Config, profile}; use util::human; use super::{Kind, Compilation, BuildConfig}; @@ -13,7 +13,7 @@ use super::layout::{Layout, LayoutProxy}; use super::custom_build::BuildState; use super::{ProcessEngine, ExecEngine}; -#[deriving(Show, Copy)] +#[derive(Show, Copy)] pub enum Platform { Target, Plugin, @@ -155,7 +155,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> { req: Platform) { let req = if target.get_profile().is_for_host() {Platform::Plugin} else {req}; - match self.requirements.entry((pkg.get_package_id(), target.get_name())) { + match self.requirements.entry(&(pkg.get_package_id(), target.get_name())) { Occupied(mut entry) => match (*entry.get(), req) { (Platform::Plugin, Platform::Plugin) | (Platform::PluginAndTarget, Platform::Plugin) | @@ -164,7 +164,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> { (Platform::PluginAndTarget, Platform::PluginAndTarget) => return, _ => *entry.get_mut() = entry.get().combine(req), }, - Vacant(entry) => { entry.set(req); } + Vacant(entry) => { entry.insert(req); } }; for &(pkg, dep) in self.dep_targets(pkg, target).iter() { diff --git a/src/cargo/ops/cargo_rustc/custom_build.rs b/src/cargo/ops/cargo_rustc/custom_build.rs index fcbc8b9d6d0..f0da72f5ffd 100644 --- a/src/cargo/ops/cargo_rustc/custom_build.rs +++ b/src/cargo/ops/cargo_rustc/custom_build.rs @@ -1,9 +1,11 @@ +use std::c_str::ToCStr; use std::collections::HashMap; use std::fmt; use std::io::fs::PathExtensions; use std::io::{fs, USER_RWX, File}; use std::str; use std::sync::Mutex; +use std::sync::mpsc::Sender; use core::{Package, Target, PackageId, PackageSet}; use util::{CargoResult, human, Human}; @@ -15,7 +17,7 @@ use super::CommandType; use util::Freshness; /// Contains the parsed output of a custom build script. -#[deriving(Clone)] +#[derive(Clone)] pub struct BuildOutput { /// Paths to pass to rustc with the `-L` flag pub library_paths: Vec, @@ -138,7 +140,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform, } // And now finally, run the build command itself! - desc_tx.send_opt(p.to_string()).ok(); + desc_tx.send(p.to_string()).ok(); let output = try!(exec_engine.exec_with_output(p).map_err(|mut e| { e.desc = format!("failed to run custom build command for `{}`\n{}", pkg_name, e.desc); @@ -178,7 +180,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform, // Also note that a fresh build command needs to let (freshness, dirty, fresh) = try!(fingerprint::prepare_build_cmd(cx, pkg, Some(target))); - let dirty = Work::new(move |tx: Sender| { + let dirty = Work::new(move |tx| { try!(work(tx.clone())); dirty.call(tx) }); diff --git a/src/cargo/ops/cargo_rustc/engine.rs b/src/cargo/ops/cargo_rustc/engine.rs index 7b043b43bff..ccd02401a32 100644 --- a/src/cargo/ops/cargo_rustc/engine.rs +++ b/src/cargo/ops/cargo_rustc/engine.rs @@ -1,9 +1,9 @@ use std::collections::HashMap; -use std::c_str::CString; +use std::c_str::{CString, ToCStr}; use std::io::process::ProcessOutput; -use std::fmt::{mod, Show, Formatter}; +use std::fmt::{self, Show, Formatter}; -use util::{mod, CargoResult, ProcessError, ProcessBuilder}; +use util::{self, CargoResult, ProcessError, ProcessBuilder}; /// Trait for objects that can execute commands. pub trait ExecEngine: Send + Sync { @@ -12,7 +12,7 @@ pub trait ExecEngine: Send + Sync { } /// Default implementation of `ExecEngine`. -#[deriving(Copy)] +#[derive(Copy)] pub struct ProcessEngine; impl ExecEngine for ProcessEngine { @@ -27,7 +27,7 @@ impl ExecEngine for ProcessEngine { } /// Prototype for a command that must be executed. -#[deriving(Clone)] +#[derive(Clone)] pub struct CommandPrototype { ty: CommandType, args: Vec, @@ -125,7 +125,7 @@ impl Show for CommandPrototype { } } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum CommandType { Rustc, Rustdoc, diff --git a/src/cargo/ops/cargo_rustc/fingerprint.rs b/src/cargo/ops/cargo_rustc/fingerprint.rs index b8e39002031..bd64d2f8725 100644 --- a/src/cargo/ops/cargo_rustc/fingerprint.rs +++ b/src/cargo/ops/cargo_rustc/fingerprint.rs @@ -1,7 +1,7 @@ use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::hash::{Hash, Hasher}; use std::hash::sip::SipHasher; -use std::io::{mod, fs, File, BufferedReader}; +use std::io::{self, fs, File, BufferedReader}; use std::io::fs::PathExtensions; use core::{Package, Target}; @@ -96,10 +96,10 @@ pub fn prepare_target(cx: &mut Context, pkg: &Package, target: &Target, } else if target.is_bin() { cx.compilation.binaries.push(dst); } else if target.is_lib() { - let pkgid = pkg.get_package_id().clone(); + let pkgid = pkg.get_package_id(); match cx.compilation.libraries.entry(pkgid) { Occupied(entry) => entry.into_mut(), - Vacant(entry) => entry.set(Vec::new()), + Vacant(entry) => entry.insert(Vec::new()), }.push(dst); } } diff --git a/src/cargo/ops/cargo_rustc/job.rs b/src/cargo/ops/cargo_rustc/job.rs index a76f3039e8e..2e68f496f3c 100644 --- a/src/cargo/ops/cargo_rustc/job.rs +++ b/src/cargo/ops/cargo_rustc/job.rs @@ -1,3 +1,5 @@ +use std::sync::mpsc::Sender; + use util::{CargoResult, Fresh, Dirty, Freshness}; pub struct Job { dirty: Work, fresh: Work } diff --git a/src/cargo/ops/cargo_rustc/job_queue.rs b/src/cargo/ops/cargo_rustc/job_queue.rs index 41f6d172323..3e075368bc4 100644 --- a/src/cargo/ops/cargo_rustc/job_queue.rs +++ b/src/cargo/ops/cargo_rustc/job_queue.rs @@ -2,6 +2,7 @@ use std::collections::HashSet; use std::collections::hash_map::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::sync::TaskPool; +use std::sync::mpsc::{channel, Sender, Receiver}; use term::color::YELLOW; use core::{Package, PackageId, Resolve, PackageSet}; @@ -48,7 +49,7 @@ struct PendingBuild { /// /// Each build step for a package is registered with one of these stages, and /// each stage has a vector of work to perform in parallel. -#[deriving(Hash, PartialEq, Eq, Clone, PartialOrd, Ord, Show, Copy)] +#[derive(Hash, PartialEq, Eq, Clone, PartialOrd, Ord, Show, Copy)] pub enum Stage { Start, BuildCustomBuild, @@ -85,9 +86,9 @@ impl<'a, 'b> JobQueue<'a, 'b> { // Record the freshness state of this package as dirty if any job is // dirty or fresh otherwise let fresh = jobs.iter().fold(Fresh, |f1, &(_, f2)| f1.combine(f2)); - match self.state.entry(pkg.get_package_id()) { + match self.state.entry(&pkg.get_package_id()) { Occupied(mut entry) => { *entry.get_mut() = entry.get().combine(fresh); } - Vacant(entry) => { entry.set(fresh); } + Vacant(entry) => { entry.insert(fresh); } }; // Add the package to the dependency graph @@ -125,7 +126,7 @@ impl<'a, 'b> JobQueue<'a, 'b> { // Now that all possible work has been scheduled, wait for a piece // of work to finish. If any package fails to build then we stop // scheduling work as quickly as possibly. - let (id, stage, fresh, result) = self.rx.recv(); + let (id, stage, fresh, result) = self.rx.recv().unwrap(); info!(" end: {} {}", id, stage); let id = *self.state.keys().find(|&k| *k == &id).unwrap(); self.active -= 1; @@ -184,10 +185,10 @@ impl<'a, 'b> JobQueue<'a, 'b> { let id = id.clone(); let (desc_tx, desc_rx) = channel(); self.pool.execute(move|| { - my_tx.send((id, stage, fresh, job.run(fresh, desc_tx))); + my_tx.send((id, stage, fresh, job.run(fresh, desc_tx))).unwrap(); }); // only the first message of each job is processed - match desc_rx.recv_opt() { + match desc_rx.recv() { Ok(msg) => running.push(msg), Err(..) => {} } @@ -196,7 +197,7 @@ impl<'a, 'b> JobQueue<'a, 'b> { // If no work was scheduled, make sure that a message is actually send // on this channel. if njobs == 0 { - self.tx.send((id, stage, fresh, Ok(()))); + self.tx.send((id, stage, fresh, Ok(()))).unwrap(); } // Print out some nice progress information diff --git a/src/cargo/ops/cargo_rustc/layout.rs b/src/cargo/ops/cargo_rustc/layout.rs index 2b277a55836..cccc42a3e1a 100644 --- a/src/cargo/ops/cargo_rustc/layout.rs +++ b/src/cargo/ops/cargo_rustc/layout.rs @@ -48,7 +48,7 @@ use std::cell::RefCell; use std::collections::HashSet; use std::io::fs::PathExtensions; -use std::io::{mod, fs, IoResult}; +use std::io::{self, fs, IoResult}; use std::mem; use core::Package; diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs index 5919615b5a8..c3d43e2e541 100644 --- a/src/cargo/ops/cargo_rustc/mod.rs +++ b/src/cargo/ops/cargo_rustc/mod.rs @@ -1,11 +1,12 @@ +use std::c_str::ToCStr; use std::collections::{HashSet, HashMap}; use std::dynamic_lib::DynamicLibrary; -use std::io::{fs, USER_RWX}; -use std::io::fs::PathExtensions; +use std::io::USER_RWX; +use std::io::fs::{self, PathExtensions}; use std::sync::Arc; use core::{SourceMap, Package, PackageId, PackageSet, Target, Resolve}; -use util::{mod, CargoResult, human, caused_human}; +use util::{self, CargoResult, human, caused_human}; use util::{Config, internal, ChainError, Fresh, profile, join_paths, Human}; use self::job::{Job, Work}; @@ -28,16 +29,16 @@ mod job_queue; mod layout; mod links; -#[deriving(PartialEq, Eq, Hash, Show, Copy)] +#[derive(PartialEq, Eq, Hash, Show, Copy)] pub enum Kind { Host, Target } -#[deriving(Default, Clone)] +#[derive(Default, Clone)] pub struct BuildConfig { pub host: TargetConfig, pub target: TargetConfig, } -#[deriving(Clone, Default)] +#[derive(Clone, Default)] pub struct TargetConfig { pub ar: Option, pub linker: Option, @@ -262,7 +263,7 @@ fn compile<'a, 'b>(targets: &[&'a Target], pkg: &'a Package, let (freshness, dirty, fresh) = try!(fingerprint::prepare_target(cx, pkg, target, kind)); - let dirty = Work::new(move |desc_tx: Sender| { + let dirty = Work::new(move |desc_tx| { try!(work.call(desc_tx.clone())); dirty.call(desc_tx) }); @@ -332,9 +333,9 @@ fn compile<'a, 'b>(targets: &[&'a Target], pkg: &'a Package, 1 => pkg.get_manifest().get_build()[0].to_string(), _ => format!("custom build commands"), }; - let dirty = Work::new(move |desc_tx: Sender| { + let dirty = Work::new(move |desc_tx| { if desc.len() > 0 { - desc_tx.send_opt(desc).ok(); + desc_tx.send(desc).ok(); } for cmd in build_cmds.into_iter() { try!(cmd.call(desc_tx.clone())) @@ -411,8 +412,8 @@ fn compile_custom_old(pkg: &Package, cmd: &str, let exec_engine = cx.exec_engine.clone(); - Ok(Work::new(move |desc_tx: Sender| { - desc_tx.send_opt(p.to_string()).ok(); + Ok(Work::new(move |desc_tx| { + desc_tx.send(p.to_string()).ok(); if first && !output.exists() { try!(fs::mkdir(&output, USER_RWX).chain_error(|| { internal("failed to create output directory for build command") @@ -516,7 +517,7 @@ fn rustc(package: &Package, target: &Target, } } - desc_tx.send_opt(rustc.to_string()).ok(); + desc_tx.send(rustc.to_string()).ok(); try!(exec_engine.exec(rustc).chain_error(|| { human(format!("Could not compile `{}`.", name)) })); @@ -588,8 +589,8 @@ fn rustdoc(package: &Package, target: &Target, let desc = rustdoc.to_string(); let exec_engine = cx.exec_engine.clone(); - Ok(Work::new(move |desc_tx: Sender| { - desc_tx.send(desc); + Ok(Work::new(move |desc_tx| { + desc_tx.send(desc).unwrap(); if primary { try!(exec_engine.exec(rustdoc).chain_error(|| { human(format!("Could not document `{}`.", name)) @@ -726,8 +727,8 @@ fn build_deps_args(mut cmd: CommandPrototype, target: &Target, package: &Package cx: &Context, kind: Kind) -> CargoResult { let layout = cx.layout(package, kind); - cmd = cmd.arg("-L").arg(layout.root()); - cmd = cmd.arg("-L").arg(layout.deps()); + cmd = cmd.arg("-L").arg(format!("dependency={}", layout.root().display())); + cmd = cmd.arg("-L").arg(format!("dependency={}", layout.deps().display())); cmd = cmd.env("OUT_DIR", if package.has_custom_build() { Some(layout.build_out(package)) @@ -745,7 +746,7 @@ fn build_deps_args(mut cmd: CommandPrototype, target: &Target, package: &Package } }); for dir in dirs.into_iter() { - cmd = cmd.arg("-L").arg(dir); + cmd = cmd.arg("-L").arg(format!("native={}", dir.display())); } for &(pkg, target) in cx.dep_targets(package, target).iter() { @@ -756,8 +757,9 @@ fn build_deps_args(mut cmd: CommandPrototype, target: &Target, package: &Package target.is_lib() && target.get_profile().is_compile() }); - if target.is_bin() && !target.get_profile().is_custom_build() { - for target in targets.filter(|f| !f.is_staticlib()) { + if (target.is_bin() || target.is_example()) && + !target.get_profile().is_custom_build() { + for target in targets.filter(|f| f.is_rlib() || f.is_dylib()) { cmd = try!(link_to(cmd, package, target, cx, kind)); } } @@ -776,6 +778,7 @@ fn build_deps_args(mut cmd: CommandPrototype, target: &Target, package: &Package }); for filename in try!(cx.target_filenames(target)).iter() { + if filename.as_bytes().ends_with(b".a") { continue } let mut v = Vec::new(); v.push_all(target.get_name().as_bytes()); v.push(b'='); diff --git a/src/cargo/ops/cargo_test.rs b/src/cargo/ops/cargo_test.rs index 888538a32ec..9d18c03b092 100644 --- a/src/cargo/ops/cargo_test.rs +++ b/src/cargo/ops/cargo_test.rs @@ -2,7 +2,7 @@ use std::os; use core::Source; use sources::PathSource; -use ops::{mod, ExecEngine, ProcessEngine}; +use ops::{self, ExecEngine, ProcessEngine}; use util::{CargoResult, ProcessError}; pub struct TestOptions<'a> { diff --git a/src/cargo/ops/lockfile.rs b/src/cargo/ops/lockfile.rs index b5a8414b0e4..463d9467695 100644 --- a/src/cargo/ops/lockfile.rs +++ b/src/cargo/ops/lockfile.rs @@ -1,7 +1,7 @@ use std::io::File; use rustc_serialize::{Encodable, Decodable}; -use toml::{mod, Encoder, Value}; +use toml::{self, Encoder, Value}; use core::{Resolve, resolver, Package, SourceId}; use util::CargoResult; diff --git a/src/cargo/ops/resolve.rs b/src/cargo/ops/resolve.rs index e1bb3948dd3..cdfac35cda6 100644 --- a/src/cargo/ops/resolve.rs +++ b/src/cargo/ops/resolve.rs @@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet}; use core::{Package, PackageId, SourceId}; use core::registry::PackageRegistry; -use core::resolver::{mod, Resolve, Method}; +use core::resolver::{self, Resolve, Method}; use ops; use util::CargoResult; diff --git a/src/cargo/sources/git/source.rs b/src/cargo/sources/git/source.rs index 605ff5a7143..711a114eeae 100644 --- a/src/cargo/sources/git/source.rs +++ b/src/cargo/sources/git/source.rs @@ -1,8 +1,8 @@ -use std::fmt::{mod, Show, Formatter}; +use std::fmt::{self, Show, Formatter}; use std::hash::Hasher; use std::hash::sip::SipHasher; use std::mem; -use url::{mod, Url}; +use url::{self, Url}; use core::source::{Source, SourceId}; use core::GitReference; diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 1f6c0aed89b..cc6d801f0f2 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -1,4 +1,4 @@ -use std::fmt::{mod, Show, Formatter}; +use std::fmt::{self, Show, Formatter}; use std::io::{USER_DIR}; use std::io::fs::{mkdir_recursive, rmdir_recursive, PathExtensions}; use rustc_serialize::{Encodable, Encoder}; @@ -8,7 +8,7 @@ use git2; use core::GitReference; use util::{CargoResult, ChainError, human, ToUrl, internal}; -#[deriving(PartialEq, Clone)] +#[derive(PartialEq, Clone)] #[allow(missing_copy_implementations)] pub struct GitRevision(git2::Oid); @@ -20,12 +20,12 @@ impl Show for GitRevision { /// GitRemote represents a remote repository. It gets cloned into a local /// GitDatabase. -#[deriving(PartialEq,Clone,Show)] +#[derive(PartialEq,Clone,Show)] pub struct GitRemote { url: Url, } -#[deriving(PartialEq,Clone,RustcEncodable)] +#[derive(PartialEq,Clone,RustcEncodable)] struct EncodableGitRemote { url: String, } @@ -46,7 +46,7 @@ pub struct GitDatabase { repo: git2::Repository, } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] pub struct EncodableGitDatabase { remote: GitRemote, path: String, @@ -71,7 +71,7 @@ pub struct GitCheckout<'a> { repo: git2::Repository, } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] pub struct EncodableGitCheckout { database: EncodableGitDatabase, location: String, diff --git a/src/cargo/sources/path.rs b/src/cargo/sources/path.rs index d6a012fc571..a068386dded 100644 --- a/src/cargo/sources/path.rs +++ b/src/cargo/sources/path.rs @@ -1,6 +1,6 @@ use std::cmp; -use std::fmt::{mod, Show, Formatter}; -use std::io::fs::{mod, PathExtensions}; +use std::fmt::{self, Show, Formatter}; +use std::io::fs::{self, PathExtensions}; use glob::Pattern; use git2; diff --git a/src/cargo/sources/registry.rs b/src/cargo/sources/registry.rs index 8239216585e..0c40ee4ccc7 100644 --- a/src/cargo/sources/registry.rs +++ b/src/cargo/sources/registry.rs @@ -158,7 +158,7 @@ //! ... //! ``` -use std::io::{mod, fs, File}; +use std::io::{self, fs, File}; use std::io::fs::PathExtensions; use std::collections::HashMap; @@ -192,7 +192,7 @@ pub struct RegistrySource<'a, 'b:'a> { updated: bool, } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub struct RegistryConfig { /// Download endpoint for all crates. This will be appended with /// `///download` and then will be hit with an HTTP GET @@ -204,7 +204,7 @@ pub struct RegistryConfig { pub api: String, } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct RegistryPackage { name: String, vers: String, @@ -214,7 +214,7 @@ struct RegistryPackage { yanked: Option, } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct RegistryDependency { name: String, req: String, diff --git a/src/cargo/util/config.rs b/src/cargo/util/config.rs index 885f4b17653..3e3f74359c2 100644 --- a/src/cargo/util/config.rs +++ b/src/cargo/util/config.rs @@ -3,7 +3,7 @@ use std::cell::{RefCell, RefMut}; use std::collections::hash_map::{HashMap}; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::io; -use std::io::fs::{mod, PathExtensions, File}; +use std::io::fs::{self, PathExtensions, File}; use std::string; use rustc_serialize::{Encodable,Encoder}; @@ -94,13 +94,13 @@ impl<'a> Config<'a> { } } -#[deriving(Eq, PartialEq, Clone, RustcEncodable, RustcDecodable, Copy)] +#[derive(Eq, PartialEq, Clone, RustcEncodable, RustcDecodable, Copy)] pub enum Location { Project, Global } -#[deriving(Eq,PartialEq,Clone,RustcDecodable)] +#[derive(Eq,PartialEq,Clone,RustcDecodable)] pub enum ConfigValue { String(string::String, Path), List(Vec<(string::String, Path)>), @@ -178,9 +178,9 @@ impl ConfigValue { (&CV::Table(ref mut old), CV::Table(ref mut new)) => { let new = mem::replace(new, HashMap::new()); for (key, value) in new.into_iter() { - match old.entry(key) { + match old.entry(&key) { Occupied(mut entry) => { try!(entry.get_mut().merge(value)); } - Vacant(entry) => { entry.set(value); } + Vacant(entry) => { entry.insert(value); } }; } } diff --git a/src/cargo/util/dependency_queue.rs b/src/cargo/util/dependency_queue.rs index 266071233eb..ae7395be434 100644 --- a/src/cargo/util/dependency_queue.rs +++ b/src/cargo/util/dependency_queue.rs @@ -40,7 +40,7 @@ pub struct DependencyQueue { /// /// A fresh package does not necessarily need to be rebuilt (unless a dependency /// was also rebuilt), and a dirty package must always be rebuilt. -#[deriving(PartialEq, Eq, Show, Copy)] +#[derive(PartialEq, Eq, Show, Copy)] pub enum Freshness { Fresh, Dirty, @@ -83,9 +83,9 @@ impl, V> DependencyQueue { let mut my_dependencies = HashSet::new(); for dep in key.dependencies(cx).into_iter() { assert!(my_dependencies.insert(dep.clone())); - let rev = match self.reverse_dep_map.entry(dep) { + let rev = match self.reverse_dep_map.entry(&dep) { Occupied(entry) => entry.into_mut(), - Vacant(entry) => entry.set(HashSet::new()), + Vacant(entry) => entry.insert(HashSet::new()), }; assert!(rev.insert(key.clone())); } diff --git a/src/cargo/util/errors.rs b/src/cargo/util/errors.rs index bfdc7ed24fd..211af049abd 100644 --- a/src/cargo/util/errors.rs +++ b/src/cargo/util/errors.rs @@ -1,5 +1,5 @@ use std::error::{FromError, Error}; -use std::fmt::{mod, Show}; +use std::fmt::{self, Show}; use std::io::IoError; use std::io::process::{ProcessOutput, ProcessExit, ExitStatus, ExitSignal}; use std::str; @@ -164,7 +164,7 @@ impl CargoError for Human { pub type CliResult = Result; -#[deriving(Show)] +#[derive(Show)] pub struct CliError { pub error: Box, pub unknown: bool, diff --git a/src/cargo/util/graph.rs b/src/cargo/util/graph.rs index b5f4a6335cc..b3214e5ff7a 100644 --- a/src/cargo/util/graph.rs +++ b/src/cargo/util/graph.rs @@ -27,9 +27,9 @@ impl Graph { } pub fn link(&mut self, node: N, child: N) { - match self.nodes.entry(node) { + match self.nodes.entry(&node) { Occupied(entry) => entry.into_mut(), - Vacant(entry) => entry.set(HashSet::new()), + Vacant(entry) => entry.insert(HashSet::new()), }.insert(child); } diff --git a/src/cargo/util/process_builder.rs b/src/cargo/util/process_builder.rs index 722ac7fdc12..5f07d4f95b9 100644 --- a/src/cargo/util/process_builder.rs +++ b/src/cargo/util/process_builder.rs @@ -1,12 +1,12 @@ -use std::fmt::{mod, Show, Formatter}; +use std::fmt::{self, Show, Formatter}; use std::os; -use std::c_str::CString; +use std::c_str::{CString, ToCStr}; use std::io::process::{Command, ProcessOutput, InheritFd}; use std::collections::HashMap; use util::{CargoResult, ProcessError, process_error}; -#[deriving(Clone,PartialEq)] +#[derive(Clone,PartialEq)] pub struct ProcessBuilder { program: CString, args: Vec, diff --git a/src/cargo/util/sha256.rs b/src/cargo/util/sha256.rs index 88419ae15e1..4736e340716 100644 --- a/src/cargo/util/sha256.rs +++ b/src/cargo/util/sha256.rs @@ -48,9 +48,9 @@ mod imp { } } - pub fn finish(&mut self) -> [u8, ..32] { + pub fn finish(&mut self) -> [u8; 32] { unsafe { - let mut ret = [0u8, ..32]; + let mut ret = [0u8; 32]; let mut out = 0; let n = EVP_DigestFinal_ex(self.ctx, ret.as_mut_ptr(), &mut out); assert_eq!(n, 1); @@ -141,8 +141,8 @@ mod imp { }) } - pub fn finish(&mut self) -> [u8, ..32] { - let mut ret = [0u8, ..32]; + pub fn finish(&mut self) -> [u8; 32] { + let mut ret = [0u8; 32]; let mut len = ret.len() as libc::DWORD; call!(unsafe { CryptGetHashParam(self.hcrypthash, HP_HASHVAL, ret.as_mut_ptr(), diff --git a/src/cargo/util/to_url.rs b/src/cargo/util/to_url.rs index f11b9641489..840d7116596 100644 --- a/src/cargo/util/to_url.rs +++ b/src/cargo/util/to_url.rs @@ -1,4 +1,4 @@ -use url::{mod, Url, UrlParser}; +use url::{self, Url, UrlParser}; pub trait ToUrl { fn to_url(self) -> Result; diff --git a/src/cargo/util/toml.rs b/src/cargo/util/toml.rs index d76b902e32d..be863795b65 100644 --- a/src/cargo/util/toml.rs +++ b/src/cargo/util/toml.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use std::fmt; -use std::io::fs::{mod, PathExtensions}; +use std::io::fs::{self, PathExtensions}; use std::os; use std::slice; use std::str; @@ -21,7 +21,7 @@ use util::{CargoResult, human, ToUrl, ToSemver, ChainError}; /// /// This structure is used to hold references to all project files that are relevant to cargo. -#[deriving(Clone)] +#[derive(Clone)] pub struct Layout { root: Path, lib: Option, @@ -182,14 +182,14 @@ type TomlBenchTarget = TomlTarget; * TODO: Make all struct fields private */ -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub enum TomlDependency { Simple(String), Detailed(DetailedTomlDependency) } -#[deriving(RustcDecodable, Clone, Default)] +#[derive(RustcDecodable, Clone, Default)] pub struct DetailedTomlDependency { version: Option, path: Option, @@ -202,7 +202,7 @@ pub struct DetailedTomlDependency { default_features: Option, } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub struct TomlManifest { package: Option>, project: Option>, @@ -219,7 +219,7 @@ pub struct TomlManifest { target: Option>, } -#[deriving(RustcDecodable, Clone, Default)] +#[derive(RustcDecodable, Clone, Default)] pub struct TomlProfiles { test: Option, doc: Option, @@ -228,7 +228,7 @@ pub struct TomlProfiles { release: Option, } -#[deriving(RustcDecodable, Clone, Default)] +#[derive(RustcDecodable, Clone, Default)] #[allow(missing_copy_implementations)] pub struct TomlProfile { opt_level: Option, @@ -238,7 +238,7 @@ pub struct TomlProfile { rpath: Option, } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub enum ManyOrOne { Many(Vec), One(T), @@ -253,7 +253,7 @@ impl ManyOrOne { } } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub struct TomlProject { name: String, version: TomlVersion, @@ -274,7 +274,7 @@ pub struct TomlProject { } // TODO: deprecated, remove -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub enum BuildCommand { Single(String), Multiple(Vec) @@ -605,7 +605,7 @@ fn process_dependencies<'a>(cx: &mut Context<'a>, Ok(()) } -#[deriving(RustcDecodable, Show, Clone)] +#[derive(RustcDecodable, Show, Clone)] struct TomlTarget { name: String, crate_type: Option>, @@ -618,14 +618,14 @@ struct TomlTarget { harness: Option, } -#[deriving(RustcDecodable, Clone)] +#[derive(RustcDecodable, Clone)] enum PathValue { String(String), Path(Path), } /// Corresponds to a `target` entry, but `TomlTarget` is already used. -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] struct TomlPlatform { dependencies: Option>, } @@ -675,7 +675,7 @@ fn normalize(libs: &[TomlLibTarget], log!(4, "normalizing toml targets; lib={}; bin={}; example={}; test={}, benches={}", libs, bins, examples, tests, benches); - #[deriving(Copy)] + #[derive(Copy)] enum TestDep { Needed, NotNeeded } fn merge(profile: Profile, toml: &Option) -> Profile { diff --git a/src/registry/Cargo.toml b/src/registry/Cargo.toml index 9c7207a7e73..4c1512437f6 100644 --- a/src/registry/Cargo.toml +++ b/src/registry/Cargo.toml @@ -8,5 +8,5 @@ name = "registry" path = "lib.rs" [dependencies] -curl = "0.1.0" -rustc-serialize = "0.1.1" +curl = "0.1" +rustc-serialize = "0.2" diff --git a/src/registry/lib.rs b/src/registry/lib.rs index 75cc5a6d258..f153592a824 100644 --- a/src/registry/lib.rs +++ b/src/registry/lib.rs @@ -1,8 +1,10 @@ +#![feature(old_orphan_check)] + extern crate curl; extern crate "rustc-serialize" as rustc_serialize; use std::fmt; -use std::io::{mod, fs, MemReader, MemWriter, File}; +use std::io::{self, fs, MemReader, MemWriter, File}; use std::collections::HashMap; use std::io::util::ChainedReader; use std::result; @@ -21,7 +23,7 @@ pub struct Registry { pub type Result = result::Result; -#[deriving(PartialEq, Copy)] +#[derive(PartialEq, Copy)] pub enum Auth { Authorized, Unauthorized @@ -37,14 +39,14 @@ pub enum Error { Io(io::IoError), } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub struct Crate { pub name: String, pub description: Option, pub max_version: String } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] pub struct NewCrate { pub name: String, pub vers: String, @@ -61,7 +63,7 @@ pub struct NewCrate { pub repository: Option, } -#[deriving(RustcEncodable)] +#[derive(RustcEncodable)] pub struct NewCrateDependency { pub optional: bool, pub default_features: bool, @@ -72,7 +74,7 @@ pub struct NewCrateDependency { pub kind: String, } -#[deriving(RustcDecodable)] +#[derive(RustcDecodable)] pub struct User { pub id: uint, pub login: String, @@ -81,12 +83,12 @@ pub struct User { pub name: Option, } -#[deriving(RustcDecodable)] struct R { ok: bool } -#[deriving(RustcDecodable)] struct ApiErrorList { errors: Vec } -#[deriving(RustcDecodable)] struct ApiError { detail: String } -#[deriving(RustcEncodable)] struct OwnersReq<'a> { users: &'a [&'a str] } -#[deriving(RustcDecodable)] struct Users { users: Vec } -#[deriving(RustcDecodable)] struct Crates { crates: Vec } +#[derive(RustcDecodable)] struct R { ok: bool } +#[derive(RustcDecodable)] struct ApiErrorList { errors: Vec } +#[derive(RustcDecodable)] struct ApiError { detail: String } +#[derive(RustcEncodable)] struct OwnersReq<'a> { users: &'a [&'a str] } +#[derive(RustcDecodable)] struct Users { users: Vec } +#[derive(RustcDecodable)] struct Crates { crates: Vec } impl Registry { pub fn new(host: String, token: Option) -> Registry { diff --git a/src/rustversion.txt b/src/rustversion.txt index 128b79ec59b..51e0fdc8de4 100644 --- a/src/rustversion.txt +++ b/src/rustversion.txt @@ -1 +1 @@ -2015-01-02 +2015-01-05 diff --git a/tests/resolve.rs b/tests/resolve.rs index d55b0a8604f..d230a78a682 100644 --- a/tests/resolve.rs +++ b/tests/resolve.rs @@ -11,7 +11,7 @@ use cargo::core::source::{SourceId, GitReference}; use cargo::core::dependency::Kind::Development; use cargo::core::{Dependency, PackageId, Summary, Registry}; use cargo::util::{CargoResult, ToUrl}; -use cargo::core::resolver::{mod, Method}; +use cargo::core::resolver::{self, Method}; fn resolve(pkg: PackageId, deps: Vec, registry: &mut R) diff --git a/tests/support/git.rs b/tests/support/git.rs index f41baf45118..af8fef689d0 100644 --- a/tests/support/git.rs +++ b/tests/support/git.rs @@ -1,4 +1,4 @@ -use std::io::{mod, fs, File}; +use std::io::{self, fs, File}; use url::Url; use git2; diff --git a/tests/support/mod.rs b/tests/support/mod.rs index 9710c078289..12d3bdfee5c 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -1,11 +1,12 @@ +use std::c_str::ToCStr; use std::error::Error; -use std::fmt::{mod, Show}; -use std::io::fs::{mod, PathExtensions}; +use std::fmt::{self, Show}; +use std::io::fs::{self, PathExtensions}; use std::io::process::{ProcessOutput}; use std::io; use std::os; use std::path::{Path,BytesContainer}; -use std::str::{mod, Str}; +use std::str::{self, Str}; use url::Url; use hamcrest as ham; @@ -24,7 +25,7 @@ pub mod registry; * */ -#[deriving(PartialEq,Clone)] +#[derive(PartialEq,Clone)] struct FileBuilder { path: Path, body: String @@ -53,7 +54,7 @@ impl FileBuilder { } } -#[deriving(PartialEq,Clone)] +#[derive(PartialEq,Clone)] struct SymlinkBuilder { dst: Path, src: Path @@ -77,7 +78,7 @@ impl SymlinkBuilder { } } -#[deriving(PartialEq,Clone)] +#[derive(PartialEq,Clone)] pub struct ProjectBuilder { name: String, root: Path, @@ -241,7 +242,7 @@ pub fn cargo_dir() -> Path { * */ -#[deriving(Clone)] +#[derive(Clone)] struct Execs { expect_stdout: Option, expect_stdin: Option, @@ -363,7 +364,8 @@ struct ZipAll { second: I2, } -impl, I2: Iterator> Iterator<(Option, Option)> for ZipAll { +impl, I2: Iterator> Iterator for ZipAll { + type Item = (Option, Option); fn next(&mut self) -> Option<(Option, Option)> { let first = self.first.next(); let second = self.second.next(); @@ -375,7 +377,7 @@ impl, I2: Iterator> Iterator<(Option, Option)> for Z } } -fn zip_all, I2: Iterator>(a: I1, b: I2) -> ZipAll { +fn zip_all, I2: Iterator>(a: I1, b: I2) -> ZipAll { ZipAll { first: a, second: b @@ -419,7 +421,7 @@ pub fn execs() -> Execs { } } -#[deriving(Clone)] +#[derive(Clone)] struct ShellWrites { expected: String } diff --git a/tests/support/paths.rs b/tests/support/paths.rs index f5b701dcd33..23ffa090337 100644 --- a/tests/support/paths.rs +++ b/tests/support/paths.rs @@ -1,13 +1,13 @@ use std::io::IoResult; -use std::io::fs::{mod, PathExtensions}; -use std::sync::atomic; +use std::io::fs::{self, PathExtensions}; +use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering}; use std::{io, os}; use cargo::util::realpath; static CARGO_INTEGRATION_TEST_DIR : &'static str = "cit"; -static NEXT_ID: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT; -thread_local!(static TASK_ID: uint = NEXT_ID.fetch_add(1, atomic::SeqCst)); +static NEXT_ID: AtomicUint = ATOMIC_UINT_INIT; +thread_local!(static TASK_ID: uint = NEXT_ID.fetch_add(1, Ordering::SeqCst)); pub fn root() -> Path { let path = os::self_exe_path().unwrap() diff --git a/tests/support/registry.rs b/tests/support/registry.rs index 769583d1ced..267e0888b6e 100644 --- a/tests/support/registry.rs +++ b/tests/support/registry.rs @@ -1,4 +1,4 @@ -use std::io::{mod, fs, File}; +use std::io::{self, fs, File}; use flate2::CompressionLevel::Default; use flate2::writer::GzEncoder; diff --git a/tests/test_cargo.rs b/tests/test_cargo.rs index 1456ea5810a..9491646c6a1 100644 --- a/tests/test_cargo.rs +++ b/tests/test_cargo.rs @@ -1,4 +1,4 @@ -use std::io::fs::{mod, PathExtensions}; +use std::io::fs::{self, PathExtensions}; use std::io; use std::io::{USER_RWX, File}; use std::os; diff --git a/tests/test_cargo_build_lib.rs b/tests/test_cargo_build_lib.rs index f559b53e8c8..6da91566935 100644 --- a/tests/test_cargo_build_lib.rs +++ b/tests/test_cargo_build_lib.rs @@ -14,8 +14,8 @@ fn verbose_output_for_lib(p: &ProjectBuilder) -> String { -C extra-filename=-[..] \ --out-dir {dir}{sep}target \ --emit=dep-info,link \ - -L {dir}{sep}target \ - -L {dir}{sep}target{sep}deps` + -L dependency={dir}{sep}target \ + -L dependency={dir}{sep}target{sep}deps` ", running = RUNNING, compiling = COMPILING, sep = path::SEP, dir = p.root().display(), url = p.url(), diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index bff29e02d05..4c333dcc39a 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -1,4 +1,4 @@ -use std::io::{mod, fs, TempDir, File}; +use std::io::{self, fs, TempDir, File}; use std::os; use std::path; @@ -757,8 +757,8 @@ test!(lto_build { --cfg ndebug \ --out-dir {dir}{sep}target{sep}release \ --emit=dep-info,link \ - -L {dir}{sep}target{sep}release \ - -L {dir}{sep}target{sep}release{sep}deps` + -L dependency={dir}{sep}target{sep}release \ + -L dependency={dir}{sep}target{sep}release{sep}deps` ", running = RUNNING, compiling = COMPILING, sep = path::SEP, dir = p.root().display(), @@ -785,8 +785,8 @@ test!(verbose_build { -C extra-filename=-[..] \ --out-dir {dir}{sep}target \ --emit=dep-info,link \ - -L {dir}{sep}target \ - -L {dir}{sep}target{sep}deps` + -L dependency={dir}{sep}target \ + -L dependency={dir}{sep}target{sep}deps` ", running = RUNNING, compiling = COMPILING, sep = path::SEP, dir = p.root().display(), @@ -815,8 +815,8 @@ test!(verbose_release_build { -C extra-filename=-[..] \ --out-dir {dir}{sep}target{sep}release \ --emit=dep-info,link \ - -L {dir}{sep}target{sep}release \ - -L {dir}{sep}target{sep}release{sep}deps` + -L dependency={dir}{sep}target{sep}release \ + -L dependency={dir}{sep}target{sep}release{sep}deps` ", running = RUNNING, compiling = COMPILING, sep = path::SEP, dir = p.root().display(), @@ -861,8 +861,8 @@ test!(verbose_release_build_deps { -C extra-filename=-[..] \ --out-dir {dir}{sep}target{sep}release{sep}deps \ --emit=dep-info,link \ - -L {dir}{sep}target{sep}release{sep}deps \ - -L {dir}{sep}target{sep}release{sep}deps` + -L dependency={dir}{sep}target{sep}release{sep}deps \ + -L dependency={dir}{sep}target{sep}release{sep}deps` {compiling} test v0.0.0 ({url}) {running} `rustc {dir}{sep}src{sep}lib.rs --crate-name test --crate-type lib \ -C opt-level=3 \ @@ -871,8 +871,8 @@ test!(verbose_release_build_deps { -C extra-filename=-[..] \ --out-dir {dir}{sep}target{sep}release \ --emit=dep-info,link \ - -L {dir}{sep}target{sep}release \ - -L {dir}{sep}target{sep}release{sep}deps \ + -L dependency={dir}{sep}target{sep}release \ + -L dependency={dir}{sep}target{sep}release{sep}deps \ --extern foo={dir}{sep}target{sep}release{sep}deps/\ {prefix}foo-[..]{suffix} \ --extern foo={dir}{sep}target{sep}release{sep}deps/libfoo-[..].rlib` @@ -920,7 +920,7 @@ test!(explicit_examples { fn main() { println!("{}, {}!", world::get_goodbye(), world::get_world()); } "#); - assert_that(p.cargo_process("test"), execs()); + assert_that(p.cargo_process("test"), execs().with_status(0)); assert_that(process(p.bin("examples/hello")).unwrap(), execs().with_stdout("Hello, World!\n")); assert_that(process(p.bin("examples/goodbye")).unwrap(), @@ -1119,7 +1119,7 @@ test!(staticlib_rlib_and_bin { foo::foo(); }"#); - assert_that(p.cargo_process("build"), execs().with_status(0)); + assert_that(p.cargo_process("build").arg("-v"), execs().with_status(0)); }); test!(opt_out_of_lib { @@ -1523,3 +1523,47 @@ test!(compile_then_delete { assert_that(p.process(cargo_dir().join("cargo")).arg("run"), execs().with_status(0)); }); + +test!(transitive_dependencies_not_available { + let p = project("foo") + .file("Cargo.toml", r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + + [dependencies.a] + path = "a" + "#) + .file("src/main.rs", "extern crate b; extern crate a; fn main() {}") + .file("a/Cargo.toml", r#" + [package] + name = "a" + version = "0.0.1" + authors = [] + + [dependencies.b] + path = "../b" + "#) + .file("a/src/lib.rs", "extern crate b;") + .file("b/Cargo.toml", r#" + [package] + name = "b" + version = "0.0.1" + authors = [] + "#) + .file("b/src/lib.rs", ""); + + assert_that(p.cargo_process("build").arg("-v"), + execs().with_status(101) + .with_stderr("\ +[..] can't find crate for `b` +[..] extern crate b; [..] +[..] +error: aborting due to previous error +Could not compile `foo`. + +Caused by: + [..] +")); +}); diff --git a/tests/test_cargo_compile_path_deps.rs b/tests/test_cargo_compile_path_deps.rs index 0c1a9d1ddc6..3e6a75294df 100644 --- a/tests/test_cargo_compile_path_deps.rs +++ b/tests/test_cargo_compile_path_deps.rs @@ -2,7 +2,7 @@ use std::io::{fs, File, USER_RWX}; use support::{project, execs, main_file, cargo_dir}; use support::{COMPILING, RUNNING}; -use support::paths::{mod, PathExt}; +use support::paths::{self, PathExt}; use hamcrest::{assert_that, existing_file}; use cargo; use cargo::util::{process}; @@ -71,7 +71,8 @@ test!(cargo_compile_with_nested_deps_shorthand { "#); assert_that(p.cargo_process("build"), - execs().with_stdout(format!("{} baz v0.5.0 ({})\n\ + execs().with_status(0) + .with_stdout(format!("{} baz v0.5.0 ({})\n\ {} bar v0.5.0 ({})\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), @@ -82,20 +83,22 @@ test!(cargo_compile_with_nested_deps_shorthand { assert_that( cargo::util::process(p.bin("foo")).unwrap(), - execs().with_stdout("test passed\n")); + execs().with_stdout("test passed\n").with_status(0)); println!("cleaning"); assert_that(p.process(cargo_dir().join("cargo")).arg("clean"), - execs().with_stdout("")); + execs().with_stdout("").with_status(0)); println!("building baz"); assert_that(p.process(cargo_dir().join("cargo")).arg("build") .arg("-p").arg("baz"), - execs().with_stdout(format!("{} baz v0.5.0 ({})\n", + execs().with_status(0) + .with_stdout(format!("{} baz v0.5.0 ({})\n", COMPILING, p.url()))); println!("building foo"); assert_that(p.process(cargo_dir().join("cargo")).arg("build") .arg("-p").arg("foo"), - execs().with_stdout(format!("{} bar v0.5.0 ({})\n\ + execs().with_status(0) + .with_stdout(format!("{} bar v0.5.0 ({})\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs index b55cc75d9c9..e33eeb5eb11 100644 --- a/tests/test_cargo_cross_compile.rs +++ b/tests/test_cargo_cross_compile.rs @@ -303,8 +303,8 @@ test!(linker_and_ar { --emit=dep-info,link \ --target {target} \ -C ar=my-ar-tool -C linker=my-linker-tool \ - -L {dir}{sep}target{sep}{target} \ - -L {dir}{sep}target{sep}{target}{sep}deps` + -L dependency={dir}{sep}target{sep}{target} \ + -L dependency={dir}{sep}target{sep}{target}{sep}deps` ", running = RUNNING, compiling = COMPILING, diff --git a/tests/test_cargo_profiles.rs b/tests/test_cargo_profiles.rs index ccf531a540f..5479fafe98c 100644 --- a/tests/test_cargo_profiles.rs +++ b/tests/test_cargo_profiles.rs @@ -35,8 +35,8 @@ test!(profile_overrides { -C rpath \ --out-dir {dir}{sep}target \ --emit=dep-info,link \ - -L {dir}{sep}target \ - -L {dir}{sep}target{sep}deps` + -L dependency={dir}{sep}target \ + -L dependency={dir}{sep}target{sep}deps` ", running = RUNNING, compiling = COMPILING, sep = path::SEP, dir = p.root().display(), @@ -89,8 +89,8 @@ test!(top_level_overrides_deps { -C extra-filename=-[..] \ --out-dir {dir}{sep}target{sep}release{sep}deps \ --emit=dep-info,link \ - -L {dir}{sep}target{sep}release{sep}deps \ - -L {dir}{sep}target{sep}release{sep}deps` + -L dependency={dir}{sep}target{sep}release{sep}deps \ + -L dependency={dir}{sep}target{sep}release{sep}deps` {compiling} test v0.0.0 ({url}) {running} `rustc {dir}{sep}src{sep}lib.rs --crate-name test --crate-type lib \ -C opt-level=1 \ @@ -99,8 +99,8 @@ test!(top_level_overrides_deps { -C extra-filename=-[..] \ --out-dir {dir}{sep}target{sep}release \ --emit=dep-info,link \ - -L {dir}{sep}target{sep}release \ - -L {dir}{sep}target{sep}release{sep}deps \ + -L dependency={dir}{sep}target{sep}release \ + -L dependency={dir}{sep}target{sep}release{sep}deps \ --extern foo={dir}{sep}target{sep}release{sep}deps/\ {prefix}foo-[..]{suffix} \ --extern foo={dir}{sep}target{sep}release{sep}deps/libfoo-[..].rlib` diff --git a/tests/test_cargo_publish.rs b/tests/test_cargo_publish.rs index 01891bac8ec..65d91503523 100644 --- a/tests/test_cargo_publish.rs +++ b/tests/test_cargo_publish.rs @@ -1,4 +1,4 @@ -use std::io::{mod, fs, File, MemReader}; +use std::io::{self, fs, File, MemReader}; use flate2::reader::GzDecoder; use tar::Archive; diff --git a/tests/test_cargo_registry.rs b/tests/test_cargo_registry.rs index 3c7abcb517b..bde5d77f166 100644 --- a/tests/test_cargo_registry.rs +++ b/tests/test_cargo_registry.rs @@ -1,9 +1,9 @@ -use std::io::{mod, fs, File}; +use std::io::{self, fs, File}; use cargo::util::process; use support::{project, execs, cargo_dir}; use support::{UPDATING, DOWNLOADING, COMPILING, PACKAGING, VERIFYING}; -use support::paths::{mod, PathExt}; +use support::paths::{self, PathExt}; use support::registry as r; use support::git; diff --git a/tests/test_cargo_search.rs b/tests/test_cargo_search.rs index 53dca1ebb1d..6a9462eaec5 100644 --- a/tests/test_cargo_search.rs +++ b/tests/test_cargo_search.rs @@ -1,4 +1,4 @@ -use std::io::{mod, fs, File}; +use std::io::{self, fs, File}; use url::Url; diff --git a/tests/test_shell.rs b/tests/test_shell.rs index cb84e1642d2..f3b07efb8a2 100644 --- a/tests/test_shell.rs +++ b/tests/test_shell.rs @@ -1,4 +1,5 @@ use std::io::{MemWriter, IoResult, ChanReader, ChanWriter}; +use std::sync::mpsc::channel; use term::{Terminal, TerminfoTerminal, color}; use hamcrest::{assert_that}; diff --git a/tests/tests.rs b/tests/tests.rs index caa4d2d0bd1..a4c1f5c797a 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1,4 +1,4 @@ -#![feature(macro_rules)] +#![feature(macro_rules, associated_types)] #![feature(phase)] #![deny(warnings)]