Skip to content

Commit

Permalink
Update to rust master
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 rust-lang#344, have
also broken some code which relies on hash_set::SetItems (now renamed to
hash_set::Iter).

This commit 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
geomaster committed Dec 23, 2014
1 parent e11c317 commit d058d24
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/cargo/core/registry.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::collections::HashSet;
use std::collections::hash_map::{HashMap, Occupied, Vacant};
use std::collections::hash_map::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};

use core::{Source, SourceId, SourceMap, Summary, Dependency, PackageId, Package};
use util::{CargoResult, ChainError, Config, human, profile};
Expand Down
3 changes: 2 additions & 1 deletion src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::cell::RefCell;
use std::collections::HashSet;
use std::collections::hash_map::{HashMap, Occupied, Vacant};
use std::collections::hash_map::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::fmt;
use std::rc::Rc;
use semver;
Expand Down
3 changes: 2 additions & 1 deletion src/cargo/ops/cargo_rustc/context.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::hash_map::{HashMap, Occupied, Vacant};
use std::collections::hash_map::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::str;
use std::sync::Arc;

Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_rustc/fingerprint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::hash_map::{Occupied, Vacant};
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};
Expand Down
3 changes: 2 additions & 1 deletion src/cargo/ops/cargo_rustc/job_queue.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::collections::HashSet;
use std::collections::hash_map::{HashMap, Occupied, Vacant};
use std::collections::hash_map::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::sync::TaskPool;
use term::color::YELLOW;

Expand Down
3 changes: 2 additions & 1 deletion src/cargo/util/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{fmt, os, mem};
use std::cell::{RefCell, RefMut};
use std::collections::hash_map::{HashMap, Occupied, Vacant};
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::string;
Expand Down
5 changes: 3 additions & 2 deletions src/cargo/util/dependency_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
//! This structure is used to store the dependency graph and dynamically update
//! it to figure out when a dependency should be built.
use std::collections::{HashMap, HashSet};
use std::collections::hash_map::{Occupied, Vacant};
use std::collections::hash_set::HashSet;
use std::collections::hash_map::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::hash::Hash;

pub use self::Freshness::{Fresh, Dirty};
Expand Down
9 changes: 5 additions & 4 deletions src/cargo/util/graph.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use std::fmt;
use std::hash::Hash;
use std::collections::{HashMap, HashSet};
use std::collections::hash_map::{Keys, Occupied, Vacant};
use std::collections::hash_set::SetItems;
use std::collections::hash_set::HashSet;
use std::collections::hash_map::{HashMap, Keys};
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::collections::hash_set::Iter;

pub struct Graph<N> {
nodes: HashMap<N, HashSet<N>>
Expand All @@ -14,7 +15,7 @@ enum Mark {
}

pub type Nodes<'a, N> = Keys<'a, N, HashSet<N>>;
pub type Edges<'a, N> = SetItems<'a, N>;
pub type Edges<'a, N> = Iter<'a, N>;

impl<N: Eq + Hash + Clone> Graph<N> {
pub fn new() -> Graph<N> {
Expand Down

0 comments on commit d058d24

Please sign in to comment.