Skip to content

Commit d058d24

Browse files
committed
Update to rust master
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.
1 parent e11c317 commit d058d24

File tree

8 files changed

+19
-12
lines changed

8 files changed

+19
-12
lines changed

src/cargo/core/registry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::collections::HashSet;
2-
use std::collections::hash_map::{HashMap, Occupied, Vacant};
2+
use std::collections::hash_map::HashMap;
3+
use std::collections::hash_map::Entry::{Occupied, Vacant};
34

45
use core::{Source, SourceId, SourceMap, Summary, Dependency, PackageId, Package};
56
use util::{CargoResult, ChainError, Config, human, profile};

src/cargo/core/resolver/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::cell::RefCell;
22
use std::collections::HashSet;
3-
use std::collections::hash_map::{HashMap, Occupied, Vacant};
3+
use std::collections::hash_map::HashMap;
4+
use std::collections::hash_map::Entry::{Occupied, Vacant};
45
use std::fmt;
56
use std::rc::Rc;
67
use semver;

src/cargo/ops/cargo_rustc/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use std::collections::hash_map::{HashMap, Occupied, Vacant};
1+
use std::collections::hash_map::HashMap;
2+
use std::collections::hash_map::Entry::{Occupied, Vacant};
23
use std::str;
34
use std::sync::Arc;
45

src/cargo/ops/cargo_rustc/fingerprint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::hash_map::{Occupied, Vacant};
1+
use std::collections::hash_map::Entry::{Occupied, Vacant};
22
use std::hash::{Hash, Hasher};
33
use std::hash::sip::SipHasher;
44
use std::io::{mod, fs, File, BufferedReader};

src/cargo/ops/cargo_rustc/job_queue.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::collections::HashSet;
2-
use std::collections::hash_map::{HashMap, Occupied, Vacant};
2+
use std::collections::hash_map::HashMap;
3+
use std::collections::hash_map::Entry::{Occupied, Vacant};
34
use std::sync::TaskPool;
45
use term::color::YELLOW;
56

src/cargo/util/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{fmt, os, mem};
22
use std::cell::{RefCell, RefMut};
3-
use std::collections::hash_map::{HashMap, Occupied, Vacant};
3+
use std::collections::hash_map::{HashMap};
4+
use std::collections::hash_map::Entry::{Occupied, Vacant};
45
use std::io;
56
use std::io::fs::{mod, PathExtensions, File};
67
use std::string;

src/cargo/util/dependency_queue.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
//! This structure is used to store the dependency graph and dynamically update
55
//! it to figure out when a dependency should be built.
66
7-
use std::collections::{HashMap, HashSet};
8-
use std::collections::hash_map::{Occupied, Vacant};
7+
use std::collections::hash_set::HashSet;
8+
use std::collections::hash_map::HashMap;
9+
use std::collections::hash_map::Entry::{Occupied, Vacant};
910
use std::hash::Hash;
1011

1112
pub use self::Freshness::{Fresh, Dirty};

src/cargo/util/graph.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use std::fmt;
22
use std::hash::Hash;
3-
use std::collections::{HashMap, HashSet};
4-
use std::collections::hash_map::{Keys, Occupied, Vacant};
5-
use std::collections::hash_set::SetItems;
3+
use std::collections::hash_set::HashSet;
4+
use std::collections::hash_map::{HashMap, Keys};
5+
use std::collections::hash_map::Entry::{Occupied, Vacant};
6+
use std::collections::hash_set::Iter;
67

78
pub struct Graph<N> {
89
nodes: HashMap<N, HashSet<N>>
@@ -14,7 +15,7 @@ enum Mark {
1415
}
1516

1617
pub type Nodes<'a, N> = Keys<'a, N, HashSet<N>>;
17-
pub type Edges<'a, N> = SetItems<'a, N>;
18+
pub type Edges<'a, N> = Iter<'a, N>;
1819

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

0 commit comments

Comments
 (0)