Remove std feature from cranelift-entity
This commit is contained in:
@@ -6,7 +6,7 @@ use crate::EntityRef;
|
||||
use core::marker::PhantomData;
|
||||
use core::ops::{Index, IndexMut};
|
||||
use core::slice;
|
||||
use std::boxed::Box;
|
||||
use alloc::boxed::Box;
|
||||
|
||||
/// A slice mapping `K -> V` allocating dense entity references.
|
||||
///
|
||||
@@ -141,7 +141,7 @@ where
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::primary::PrimaryMap;
|
||||
use std::vec::Vec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
// `EntityRef` impl for testing.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
|
||||
#![warn(unused_import_braces)]
|
||||
#![cfg_attr(feature = "std", deny(unstable_features))]
|
||||
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
|
||||
#![cfg_attr(
|
||||
feature = "cargo-clippy",
|
||||
@@ -52,12 +51,7 @@
|
||||
)]
|
||||
#![no_std]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
#[macro_use]
|
||||
extern crate alloc as std;
|
||||
#[cfg(feature = "std")]
|
||||
#[macro_use]
|
||||
extern crate std;
|
||||
extern crate alloc;
|
||||
|
||||
// Re-export core so that the macros works with both std and no_std crates
|
||||
#[doc(hidden)]
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::packed_option::ReservedValue;
|
||||
use crate::EntityRef;
|
||||
use core::marker::PhantomData;
|
||||
use core::mem;
|
||||
use std::vec::Vec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A small list of entity references allocated from a pool.
|
||||
///
|
||||
|
||||
@@ -13,7 +13,7 @@ use serde::{
|
||||
ser::{SerializeSeq, Serializer},
|
||||
Deserialize, Serialize,
|
||||
};
|
||||
use std::vec::Vec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A mapping `K -> V` for densely indexed entity references.
|
||||
///
|
||||
@@ -222,7 +222,7 @@ where
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
use std::fmt;
|
||||
use alloc::fmt;
|
||||
struct SecondaryMapVisitor<K, V> {
|
||||
unused: PhantomData<fn(K) -> V>,
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ use core::ops::{Index, IndexMut};
|
||||
use core::slice;
|
||||
#[cfg(feature = "enable-serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::boxed::Box;
|
||||
use std::vec::Vec;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A primary mapping `K -> V` allocating dense entity references.
|
||||
///
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use crate::keys::Keys;
|
||||
use crate::EntityRef;
|
||||
use core::marker::PhantomData;
|
||||
use std::vec::Vec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A set of `K` for densely indexed entity references.
|
||||
///
|
||||
|
||||
@@ -12,7 +12,7 @@ use crate::EntityRef;
|
||||
use core::mem;
|
||||
use core::slice;
|
||||
use core::u32;
|
||||
use std::vec::Vec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Trait for extracting keys from values stored in a `SparseMap`.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user