Skip to content

Commit 849637f

Browse files
committed
Auto merge of #180 - Amanieu:insert_no_grow, r=Amanieu
Expose insert_no_grow under the "raw" feature
2 parents cd5a2e2 + 3ba4e56 commit 849637f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
#![allow(
2727
clippy::doc_markdown,
2828
clippy::module_name_repetitions,
29-
clippy::must_use_candidate
29+
clippy::must_use_candidate,
30+
clippy::option_if_let_else,
3031
)]
3132
#![warn(missing_docs)]
3233
#![warn(rust_2018_idioms)]

src/raw/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ impl Iterator for ProbeSeq {
173173
/// taking the maximum load factor into account.
174174
///
175175
/// Returns `None` if an overflow occurs.
176-
#[cfg_attr(feature = "inline-more", inline)]
177176
// Workaround for emscripten bug emscripten-core/emscripten-fastcomp#258
178177
#[cfg_attr(target_os = "emscripten", inline(never))]
178+
#[cfg_attr(not(target_os = "emscripten"), inline)]
179179
fn capacity_to_buckets(cap: usize) -> Option<usize> {
180180
debug_assert_ne!(cap, 0);
181181

@@ -202,7 +202,7 @@ fn capacity_to_buckets(cap: usize) -> Option<usize> {
202202

203203
/// Returns the maximum effective capacity for the given bucket mask, taking
204204
/// the maximum load factor into account.
205-
#[cfg_attr(feature = "inline-more", inline)]
205+
#[inline]
206206
fn bucket_mask_to_capacity(bucket_mask: usize) -> usize {
207207
if bucket_mask < 8 {
208208
// For tables with 1/2/4/8 buckets, we always reserve one empty slot.
@@ -916,7 +916,7 @@ impl<T> RawTable<T> {
916916
///
917917
/// This does not check if the given element already exists in the table.
918918
#[cfg_attr(feature = "inline-more", inline)]
919-
#[cfg(feature = "rustc-internal-api")]
919+
#[cfg(any(feature = "raw", feature = "rustc-internal-api"))]
920920
pub fn insert_no_grow(&mut self, hash: u64, value: T) -> Bucket<T> {
921921
unsafe {
922922
let index = self.find_insert_slot(hash);

0 commit comments

Comments
 (0)