Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ members = ["asm-test"]
nightly-bench = ["criterion/real_blackbox"]

[dependencies]
no-std-compat = { version = "0.2.0", features = ["alloc"] }

[dev-dependencies]
quickcheck = "0.8"
Expand Down
15 changes: 13 additions & 2 deletions src/core/bitvec.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
use std::{
alloc::{alloc, alloc_zeroed, dealloc, handle_alloc_error, realloc, Layout},
use ::core::{
fmt,
mem::{align_of, size_of},
ptr::{self, NonNull},
};

use alloc::{
//
alloc::{
alloc,
alloc_zeroed,
dealloc,
handle_alloc_error,
realloc,
Layout
}
};

use super::Core;


Expand Down
3 changes: 1 addition & 2 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
//! implementation, making the stable vector work. See [`Core`][core::Core] for
//! more information.

use std::{
prelude::v1::*,
use ::core::{
fmt,
marker::PhantomData,
ops::{Deref, DerefMut},
Expand Down
5 changes: 3 additions & 2 deletions src/core/option.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::{
prelude::v1::*,
use ::core::{
fmt,
hint::unreachable_unchecked,
ptr,
};

use alloc::vec::Vec;

use super::Core;

/// A `Core` implementation that is essentially a `Vec<Option<T>>`.
Expand Down
2 changes: 1 addition & 1 deletion src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! This is in its own module to not pollute the top-level namespace.

use std::{
use ::core::{
iter::FusedIterator,
ops::Range,
};
Expand Down
22 changes: 6 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,30 +97,20 @@
#![deny(missing_debug_implementations)]
#![deny(intra_doc_link_resolution_failure)]

// ----- Deal with `no_std` stuff --------------------------------------------
#![no_std]
// enable `no_std` for everything except for tests.
#![cfg_attr(not(test), no_std)]
extern crate alloc;

// Import the real `std` for tests.
#[cfg(test)]
#[macro_use]
extern crate std;

// When compiling in a normal way, we use this compatibility layer that
// reexports symbols from `core` and `alloc` under the name `std`. This is just
// convenience so that all other imports in this crate can just use `std`.
#[cfg(not(test))]
extern crate no_std_compat as std;
// ---------------------------------------------------------------------------


use std::{
prelude::v1::*,
use ::core::{
cmp,
fmt,
iter::FromIterator,
mem,
ops::{Index, IndexMut},
};
use alloc::vec::Vec;

use crate::{
core::{Core, DefaultCore, OwningCore, OptionCore, BitVecCore},
iter::{Indices, Iter, IterMut, IntoIter, Values, ValuesMut},
Expand Down