diff --git a/cranelift/codegen/Cargo.toml b/cranelift/codegen/Cargo.toml index dae5e033c7..2739160aa2 100644 --- a/cranelift/codegen/Cargo.toml +++ b/cranelift/codegen/Cargo.toml @@ -14,7 +14,7 @@ edition = "2018" [dependencies] cranelift-codegen-shared = { path = "./shared", version = "0.44.0" } -cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false } +cranelift-entity = { path = "../cranelift-entity", version = "0.44.0" } cranelift-bforest = { path = "../cranelift-bforest", version = "0.44.0" } failure = { version = "0.1.1", default-features = false, features = ["derive"] } failure_derive = { version = "0.1.1", default-features = false } @@ -37,10 +37,7 @@ default = ["std"] # The "std" feature enables use of libstd. The "core" feature enables use # of some minimal std-like replacement libraries. At least one of these two # features need to be enabled. -std = [ - "cranelift-entity/std", - "cranelift-codegen-meta/std" -] +std = ["cranelift-codegen-meta/std"] # The "core" features enables use of "hashbrown" since core doesn't have # a HashMap implementation, and a workaround for Cargo #4866. diff --git a/cranelift/codegen/meta/Cargo.toml b/cranelift/codegen/meta/Cargo.toml index 2d75957355..74cc0accd3 100644 --- a/cranelift/codegen/meta/Cargo.toml +++ b/cranelift/codegen/meta/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [dependencies] cranelift-codegen-shared = { path = "../shared", version = "0.44.0" } -cranelift-entity = { path = "../../cranelift-entity", version = "0.44.0", default-features = false } +cranelift-entity = { path = "../../cranelift-entity", version = "0.44.0" } [badges] maintenance = { status = "experimental" } @@ -18,6 +18,6 @@ travis-ci = { repository = "CraneStation/cranelift" } [features] default = ["std"] -std = ["cranelift-entity/std"] +std = [] # The "core" feature enables a workaround for Cargo #4866. -core = ["cranelift-entity/core"] +core = [] diff --git a/cranelift/entity/Cargo.toml b/cranelift/entity/Cargo.toml index 65b9bc7aaa..e6f1ec6310 100644 --- a/cranelift/entity/Cargo.toml +++ b/cranelift/entity/Cargo.toml @@ -15,9 +15,6 @@ edition = "2018" serde = { version = "1.0.94", features = ["derive"], optional = true } [features] -default = ["std"] -std = [] -core = [] enable-serde = ["serde"] [badges] diff --git a/cranelift/entity/src/boxed_slice.rs b/cranelift/entity/src/boxed_slice.rs index 2030c6b536..302cab0235 100644 --- a/cranelift/entity/src/boxed_slice.rs +++ b/cranelift/entity/src/boxed_slice.rs @@ -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)] diff --git a/cranelift/entity/src/lib.rs b/cranelift/entity/src/lib.rs index aa10264ab8..793a8af27a 100644 --- a/cranelift/entity/src/lib.rs +++ b/cranelift/entity/src/lib.rs @@ -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)] diff --git a/cranelift/entity/src/list.rs b/cranelift/entity/src/list.rs index 009b3d70b1..263a981bb3 100644 --- a/cranelift/entity/src/list.rs +++ b/cranelift/entity/src/list.rs @@ -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. /// diff --git a/cranelift/entity/src/map.rs b/cranelift/entity/src/map.rs index 884f812fb2..937c4a49d9 100644 --- a/cranelift/entity/src/map.rs +++ b/cranelift/entity/src/map.rs @@ -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 { unused: PhantomData V>, } diff --git a/cranelift/entity/src/primary.rs b/cranelift/entity/src/primary.rs index 9cde5e779d..a464fe60f8 100644 --- a/cranelift/entity/src/primary.rs +++ b/cranelift/entity/src/primary.rs @@ -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. /// diff --git a/cranelift/entity/src/set.rs b/cranelift/entity/src/set.rs index fa74ba453f..2379fe2a7d 100644 --- a/cranelift/entity/src/set.rs +++ b/cranelift/entity/src/set.rs @@ -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. /// diff --git a/cranelift/entity/src/sparse.rs b/cranelift/entity/src/sparse.rs index 83c519f47f..43d8d4d431 100644 --- a/cranelift/entity/src/sparse.rs +++ b/cranelift/entity/src/sparse.rs @@ -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`. /// diff --git a/cranelift/module/Cargo.toml b/cranelift/module/Cargo.toml index 2ce44cc32c..c67957c6f6 100644 --- a/cranelift/module/Cargo.toml +++ b/cranelift/module/Cargo.toml @@ -12,14 +12,14 @@ edition = "2018" [dependencies] cranelift-codegen = { path = "../cranelift-codegen", version = "0.44.0", default-features = false } -cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false } +cranelift-entity = { path = "../cranelift-entity", version = "0.44.0" } hashbrown = { version = "0.6", optional = true } failure = { version = "0.1.1", default-features = false } log = { version = "0.4.6", default-features = false } [features] default = ["std"] -std = ["cranelift-codegen/std", "cranelift-entity/std"] +std = ["cranelift-codegen/std"] core = ["hashbrown", "cranelift-codegen/core"] [badges] diff --git a/cranelift/preopt/Cargo.toml b/cranelift/preopt/Cargo.toml index 64f246da46..c18188cf77 100644 --- a/cranelift/preopt/Cargo.toml +++ b/cranelift/preopt/Cargo.toml @@ -13,14 +13,14 @@ edition = "2018" [dependencies] cranelift-codegen = { path = "../cranelift-codegen", version = "0.44.0", default-features = false } -cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false } +cranelift-entity = { path = "../cranelift-entity", version = "0.44.0" } # This is commented out because it doesn't build on Rust 1.25.0, which # cranelift currently supports. # rustc_apfloat = { version = "0.1.2", default-features = false } [features] default = ["std"] -std = ["cranelift-codegen/std", "cranelift-entity/std"] +std = ["cranelift-codegen/std"] core = ["cranelift-codegen/core"] [badges] diff --git a/cranelift/wasm/Cargo.toml b/cranelift/wasm/Cargo.toml index 5e2a9e1cbe..c1e4bdd80b 100644 --- a/cranelift/wasm/Cargo.toml +++ b/cranelift/wasm/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] wasmparser = { version = "0.39.1", default-features = false } cranelift-codegen = { path = "../cranelift-codegen", version = "0.44.0", default-features = false } -cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false } +cranelift-entity = { path = "../cranelift-entity", version = "0.44.0" } cranelift-frontend = { path = "../cranelift-frontend", version = "0.44.0", default-features = false } hashbrown = { version = "0.6", optional = true } failure = { version = "0.1.1", default-features = false, features = ["derive"] }