Skip to content

Commit

Permalink
auto merge of #1085 : geomaster/cargo/master, r=alexcrichton
Browse files Browse the repository at this point in the history
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes
to the namespacing within the std::collections::hash_map, breaking some
of Cargo code which imported these.

rust-lang/rust@cf350ea, implementing changes proposed by RFC #344, have
also broken some code which relies on hash_set::SetItems (now renamed to
hash_set::Iter).

This PR fixes the incompatibilities: imports of
std::collections::hash_map::{Occupied, Vacant} have been replaced by
imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one
instance where the SetItems has been used was replaced by the proper
usage of Iter.
  • Loading branch information
bors committed Dec 25, 2014
2 parents 1f57f15 + c55a992 commit 764644a
Show file tree
Hide file tree
Showing 60 changed files with 262 additions and 172 deletions.
73 changes: 43 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ name = "cargo"
path = "src/cargo/lib.rs"

[dependencies]
toml = "0.1.4"
url = "0.2.0"
semver = "0.1.0"
curl = "0.1.0"
tar = "0.1.0"
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"

[dependencies.docopt]
git = "https://github.com/alexcrichton/docopt.rs"
branch = "update"
docopt = "0.6.19"
url = "0.2.7"
rustc-serialize = "0.1.1"

[dev-dependencies.hamcrest]
git = "https://github.com/carllerche/hamcrest-rust.git"
Expand Down
2 changes: 1 addition & 1 deletion src/bin/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError, CargoError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_no_run: bool,
flag_package: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cargo::ops;
use cargo::util::important_paths::{find_root_manifest_for_cwd};
use cargo::util::{CliResult, CliError};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_package: Option<String>,
flag_jobs: Option<uint>,
Expand Down
8 changes: 4 additions & 4 deletions src/bin/cargo.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![feature(phase, macro_rules)]
#![deny(warnings)]

extern crate serialize;
extern crate "rustc-serialize" as rustc_serialize;
#[phase(plugin, link)] extern crate log;
#[phase(plugin, link)] extern crate cargo;

Expand All @@ -13,9 +13,9 @@ 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};
use cargo::util::{CliError, CliResult, lev_distance};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Flags {
flag_list: bool,
flag_verbose: bool,
Expand Down Expand Up @@ -139,7 +139,7 @@ fn find_closest(cmd: &str) -> Option<String> {
// doing it this way (instead of just .min_by(|c| c.lev_distance(cmd)))
// allows us to only make suggestions that have an edit distance of
// 3 or less
.map(|c| (c.lev_distance(cmd), c))
.map(|c| (lev_distance(c.as_slice(), cmd), c))
.filter(|&(d, _): &(uint, &String)| d < 4u)
.min_by(|&(d, _)| d) {
Some((_, c)) => {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_package: Option<String>,
flag_target: Option<String>,
Expand Down
4 changes: 2 additions & 2 deletions src/bin/config_for_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use std::collections::HashMap;
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError, config};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct ConfigForKeyFlags {
flag_human: bool,
flag_key: String,
}

#[deriving(Encodable)]
#[deriving(RustcEncodable)]
struct ConfigOut {
values: HashMap<String, config::ConfigValue>
}
Expand Down
4 changes: 2 additions & 2 deletions src/bin/config_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use std::collections::HashMap;
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError, config};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct ConfigListFlags {
flag_human: bool,
}

#[deriving(Encodable)]
#[deriving(RustcEncodable)]
struct ConfigOut {
values: HashMap<String, config::ConfigValue>
}
Expand Down
2 changes: 1 addition & 1 deletion src/bin/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_features: Vec<String>,
flag_jobs: Option<uint>,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_manifest_path: Option<String>,
flag_verbose: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/generate_lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_manifest_path: Option<String>,
flag_verbose: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/git_checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use cargo::core::source::{Source, SourceId};
use cargo::sources::git::{GitSource};
use cargo::util::{Config, CliResult, CliError, human, ToUrl};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_url: String,
flag_reference: String,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/help.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options;

pub const USAGE: &'static str = "
Expand Down
4 changes: 2 additions & 2 deletions src/bin/locate_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError, human, Require};
use cargo::util::important_paths::{find_root_manifest_for_cwd};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct LocateProjectFlags {
flag_manifest_path: Option<String>,
}
Expand All @@ -16,7 +16,7 @@ Options:
-h, --help Print this message
";

#[deriving(Encodable)]
#[deriving(RustcEncodable)]
struct ProjectLocation {
root: String
}
Expand Down
2 changes: 1 addition & 1 deletion src/bin/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo::core::{MultiShell, SourceId, Source};
use cargo::sources::RegistrySource;
use cargo::util::{CliResult, CliError, Config};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_host: Option<String>,
arg_token: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cargo::ops;
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_verbose: bool,
flag_bin: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use cargo::ops;
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
arg_crate: Option<String>,
flag_token: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;

#[deriving(Decodable)]
#[deriving(RustcDecodable)]
struct Options {
flag_verbose: bool,
flag_manifest_path: Option<String>,
Expand Down
Loading

0 comments on commit 764644a

Please sign in to comment.