Skip to content

Commit 2642619

Browse files
committed
WIP hashbrown support
1 parent 05812fa commit 2642619

File tree

9 files changed

+22
-7
lines changed

9 files changed

+22
-7
lines changed

src/Cargo.lock

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,15 @@ dependencies = [
896896
"serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
897897
]
898898

899+
[[package]]
900+
name = "hashbrown"
901+
version = "0.1.2"
902+
source = "git+https://github.com/Amanieu/hashbrown.git?branch=stage0#50ddb15f515c1eaa31125a229b68fdf5f2cc2ce2"
903+
dependencies = [
904+
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
905+
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
906+
]
907+
899908
[[package]]
900909
name = "hex"
901910
version = "0.3.2"
@@ -2162,6 +2171,7 @@ dependencies = [
21622171
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
21632172
"ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
21642173
"graphviz 0.0.0",
2174+
"hashbrown 0.1.2 (git+https://github.com/Amanieu/hashbrown.git?branch=stage0)",
21652175
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
21662176
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
21672177
"parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3249,6 +3259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32493259
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
32503260
"checksum globset 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8e49edbcc9c7fc5beb8c0a54e7319ff8bed353a2b55e85811c6281188c2a6c84"
32513261
"checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd"
3262+
"checksum hashbrown 0.1.2 (git+https://github.com/Amanieu/hashbrown.git?branch=stage0)" = "<none>"
32523263
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
32533264
"checksum home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "80dff82fb58cfbbc617fb9a9184b010be0529201553cda50ad04372bc2333aff"
32543265
"checksum html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b04478cf718862650a0bf66acaf8f2f8c906fbc703f35c916c1f4211b069a364"

src/librustc_data_structures/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ rustc-rayon = "0.1.1"
2121
rustc-rayon-core = "0.1.1"
2222
rustc-hash = "1.0.1"
2323
smallvec = { version = "0.6.5", features = ["union"] }
24+
hashbrown = { git = "https://github.com/Amanieu/hashbrown.git", branch = "stage0" }
2425

2526
[dependencies.parking_lot]
2627
version = "0.6"

src/librustc_data_structures/fx.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
pub use rustc_hash::FxHashMap;
12-
pub use rustc_hash::FxHashSet;
11+
use core::hash::BuildHasherDefault;
12+
pub type FxHashMap<K, V> = hashbrown::HashMap<K, V, BuildHasherDefault<FxHasher>>;
13+
pub type FxHashSet<K> = hashbrown::HashSet<K, BuildHasherDefault<FxHasher>>;
1314
pub use rustc_hash::FxHasher;
15+
pub use hashbrown::hash_map::Entry;

src/librustc_data_structures/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern crate rustc_hash;
5151
extern crate serialize;
5252
extern crate graphviz;
5353
extern crate smallvec;
54+
extern crate hashbrown;
5455

5556
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
5657
#[allow(unused_extern_crates)]

src/librustc_data_structures/obligation_forest/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use fx::{FxHashMap, FxHashSet};
1919

2020
use std::cell::Cell;
21-
use std::collections::hash_map::Entry;
21+
use fx::Entry;
2222
use std::fmt::Debug;
2323
use std::hash;
2424
use std::marker::PhantomData;

src/libsyntax/ext/tt/macro_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ use symbol::keywords;
9797
use tokenstream::{DelimSpan, TokenStream};
9898

9999
use rustc_data_structures::fx::FxHashMap;
100-
use std::collections::hash_map::Entry::{Occupied, Vacant};
100+
use rustc_data_structures::fx::Entry::{Occupied, Vacant};
101101
use std::mem;
102102
use std::ops::{Deref, DerefMut};
103103
use std::rc::Rc;

src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use tokenstream::{DelimSpan, TokenStream, TokenTree};
2929

3030
use rustc_data_structures::fx::FxHashMap;
3131
use std::borrow::Cow;
32-
use std::collections::hash_map::Entry;
32+
use rustc_data_structures::fx::Entry;
3333

3434
use rustc_data_structures::sync::Lrc;
3535
use errors::Applicability;

src/libsyntax_ext/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use errors::Applicability;
2626

2727
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
2828
use std::borrow::Cow;
29-
use std::collections::hash_map::Entry;
29+
use rustc_data_structures::fx::Entry;
3030

3131
#[derive(PartialEq)]
3232
enum ArgumentType {

src/tools/lldb

Submodule lldb updated from 29bf485 to 7728fa2

0 commit comments

Comments
 (0)