Skip to content

Commit 39d6b83

Browse files
bors[bot]Kyle Clemens
andcommitted
Merge #29
29: fix: enable alloc_layout_extra for nightly feature r=Amanieu a=jkcclemens The latest nightly builds have apparently put `alloc_layout_extra` behind a feature gate, causing compilation failures with the nightly feature enabled. This adds the feature. ``` error[E0658]: use of unstable library feature 'alloc_layout_extra' (see issue #55724) --> /Users/kyleclemens/.cargo/git/checkouts/hashbrown-fc08982fe9a23efa/4496e06/src/raw/mod.rs:147:16 | 147 | let data = Layout::array::<T>(buckets).ok()?; | ^^^^^^^^^^^^^^^^^^ | = help: add #![feature(alloc_layout_extra)] to the crate attributes to enable ``` Co-authored-by: Kyle Clemens <github@kyleclemens.com>
2 parents 4496e06 + d7a8896 commit 39d6b83

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#![no_std]
1313
#![cfg_attr(
1414
feature = "nightly",
15-
feature(alloc, allocator_api, ptr_offset_from, test, core_intrinsics)
15+
feature(alloc, alloc_layout_extra, allocator_api, ptr_offset_from, test, core_intrinsics)
1616
)]
1717
#![warn(missing_docs)]
1818

src/raw/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ fn calculate_layout<T>(buckets: usize) -> Option<(Layout, usize)> {
153153
// perform bounds-checking while probing.
154154
let ctrl = Layout::array::<u8>(buckets + Group::WIDTH)
155155
.ok()?
156-
.align_to(Group::WIDTH);
156+
.align_to(Group::WIDTH)
157+
.ok()?;
157158

158159
ctrl.extend(data).ok()
159160
}

0 commit comments

Comments
 (0)