no need to bootstrap

This commit is contained in:
Mark Mansi 2019-12-18 12:04:47 -06:00
parent 253543560a
commit 7d268119f0
2 changed files with 2 additions and 9 deletions

View File

@ -85,7 +85,7 @@
#![feature(const_generic_impls_guard)] #![feature(const_generic_impls_guard)]
#![feature(const_generics)] #![feature(const_generics)]
#![feature(const_in_array_repeat_expressions)] #![feature(const_in_array_repeat_expressions)]
#![cfg_attr(not(bootstrap), feature(const_if_match))] #![feature(const_if_match)]
#![feature(cow_is_borrowed)] #![feature(cow_is_borrowed)]
#![feature(dispatch_from_dyn)] #![feature(dispatch_from_dyn)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]

View File

@ -52,14 +52,7 @@ impl<T, A: Alloc> RawVec<T, A> {
/// Like `new`, but parameterized over the choice of allocator for /// Like `new`, but parameterized over the choice of allocator for
/// the returned `RawVec`. /// the returned `RawVec`.
pub const fn new_in(a: A) -> Self { pub const fn new_in(a: A) -> Self {
// FIXME(mark-i-m): remove bootstrapping cfgs these after a cycle let cap = if mem::size_of::<T>() == 0 { core::usize::MAX } else { 0 };
let cap = {
#[cfg(not(bootstrap))]
{ if mem::size_of::<T>() == 0 { core::usize::MAX } else { 0 } }
#[cfg(bootstrap)]
[0, !0][(mem::size_of::<T>() == 0) as usize]
};
// `Unique::empty()` doubles as "unallocated" and "zero-sized allocation". // `Unique::empty()` doubles as "unallocated" and "zero-sized allocation".
RawVec { RawVec {