@@ -225,32 +225,6 @@ fn bucket_mask_to_capacity(bucket_mask: usize) -> usize {
225
225
}
226
226
}
227
227
228
- /// Returns a Layout which describes the allocation required for a hash table,
229
- /// and the offset of the control bytes in the allocation.
230
- /// (the offset is also one past last element of buckets)
231
- ///
232
- /// Returns `None` if an overflow occurs.
233
- #[ cfg_attr( feature = "inline-more" , inline) ]
234
- #[ cfg( feature = "nightly" ) ]
235
- fn calculate_layout < T > ( buckets : usize ) -> Option < ( Layout , usize ) > {
236
- debug_assert ! ( buckets. is_power_of_two( ) ) ;
237
-
238
- // Array of buckets
239
- let data = Layout :: array :: < T > ( buckets) . ok ( ) ?;
240
-
241
- // Array of control bytes. This must be aligned to the group size.
242
- //
243
- // We add `Group::WIDTH` control bytes at the end of the array which
244
- // replicate the bytes at the start of the array and thus avoids the need to
245
- // perform bounds-checking while probing.
246
- //
247
- // There is no possible overflow here since buckets is a power of two and
248
- // Group::WIDTH is a small number.
249
- let ctrl = unsafe { Layout :: from_size_align_unchecked ( buckets + Group :: WIDTH , Group :: WIDTH ) } ;
250
-
251
- data. extend ( ctrl) . ok ( )
252
- }
253
-
254
228
/// Helper which allows the max calculation for ctrl_align to be statically computed for each T
255
229
/// while keeping the rest of `calculate_layout_for` independent of `T`
256
230
#[ derive( Copy , Clone ) ]
@@ -292,7 +266,6 @@ impl TableLayout {
292
266
///
293
267
/// Returns `None` if an overflow occurs.
294
268
#[ cfg_attr( feature = "inline-more" , inline) ]
295
- #[ cfg( not( feature = "nightly" ) ) ]
296
269
fn calculate_layout < T > ( buckets : usize ) -> Option < ( Layout , usize ) > {
297
270
TableLayout :: new :: < T > ( ) . calculate_layout_for ( buckets)
298
271
}
0 commit comments