Skip to content

Commit 5998edc

Browse files
bors[bot]Amanieu
andcommitted
Merge #31
31: Add raw_entry + misc cleanups r=Amanieu a=Amanieu This PR adds: - The `raw_entry` API from std. - Support for `#[may_dangle]` when the `nightly` feature is enabled. - `HashMap` and `HashSet` tests from std. - Misc code cleanups. - `try_reserve`. - Fixed variance on `IterMut`. Fixes #23 Fixes #39 Co-authored-by: Amanieu d'Antras <[email protected]>
2 parents 341e550 + b938576 commit 5998edc

File tree

11 files changed

+2461
-395
lines changed

11 files changed

+2461
-395
lines changed

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ branches:
3232
- trying.tmp
3333
- staging.tmp
3434

35+
before_script:
36+
- if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then rustup component add rustfmt; fi
37+
3538
script:
39+
- if [ "$TRAVIS_RUST_VERSION" == "stable" ]; then cargo fmt -- --check; fi
40+
3641
- cargo build --verbose --features "$FEATURES"
3742
- cargo test --verbose --features "$FEATURES"
3843
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo bench --verbose --features "$FEATURES"; fi

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extern crate hashbrown;
7373

7474
This crate has the following Cargo features:
7575

76-
- `nightly`: Enables nightly-only features: `no_std` support and ~10% speedup from branch hint intrinsics.
76+
- `nightly`: Enables nightly-only features: `no_std` support, `#[may_dangle]` and ~10% speedup from branch hint intrinsics.
7777

7878
## License
7979

benches/bench.rs

-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
4-
//
5-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
// option. This file may not be copied, modified, or distributed
9-
// except according to those terms.
10-
111
#![feature(test)]
122

133
extern crate hashbrown;

src/lib.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@
1818
allocator_api,
1919
ptr_offset_from,
2020
test,
21-
core_intrinsics
21+
core_intrinsics,
22+
dropck_eyepatch
2223
)
2324
)]
2425
#![warn(missing_docs)]
2526

27+
#[cfg(test)]
28+
#[macro_use]
29+
extern crate std;
30+
#[cfg(test)]
31+
extern crate rand;
32+
2633
#[cfg(feature = "nightly")]
2734
#[cfg_attr(test, macro_use)]
2835
extern crate alloc;
@@ -73,3 +80,13 @@ pub mod hash_set {
7380

7481
pub use map::HashMap;
7582
pub use set::HashSet;
83+
84+
/// Augments `AllocErr` with a CapacityOverflow variant.
85+
#[derive(Clone, PartialEq, Eq, Debug)]
86+
pub enum CollectionAllocErr {
87+
/// Error due to the computed capacity exceeding the collection's maximum
88+
/// (usually `isize::MAX` bytes).
89+
CapacityOverflow,
90+
/// Error due to the allocator (see the `AllocErr` type's docs).
91+
AllocErr,
92+
}

0 commit comments

Comments
 (0)