From d25e611946cd14587b16a710e72d3f8285dff493 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 28 Sep 2019 15:39:58 +0200 Subject: [PATCH] Remove std feature from cranelift-bforest --- cranelift/bforest/Cargo.toml | 5 ----- cranelift/bforest/src/lib.rs | 8 +------- cranelift/bforest/src/map.rs | 6 +++--- cranelift/bforest/src/node.rs | 2 +- cranelift/bforest/src/pool.rs | 2 +- cranelift/bforest/src/set.rs | 6 +++--- cranelift/codegen/Cargo.toml | 3 +-- 7 files changed, 10 insertions(+), 22 deletions(-) diff --git a/cranelift/bforest/Cargo.toml b/cranelift/bforest/Cargo.toml index 960827da52..4dc95212e9 100644 --- a/cranelift/bforest/Cargo.toml +++ b/cranelift/bforest/Cargo.toml @@ -14,11 +14,6 @@ edition = "2018" [dependencies] cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false } -[features] -default = ["std"] -std = ["cranelift-entity/std"] -core = [] - [badges] maintenance = { status = "experimental" } travis-ci = { repository = "CraneStation/cranelift" } diff --git a/cranelift/bforest/src/lib.rs b/cranelift/bforest/src/lib.rs index 5d33068b7a..2f5c1060a0 100644 --- a/cranelift/bforest/src/lib.rs +++ b/cranelift/bforest/src/lib.rs @@ -15,7 +15,6 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] #![warn(unused_import_braces)] -#![cfg_attr(feature = "std", warn(unstable_features))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))] #![cfg_attr( @@ -34,13 +33,8 @@ #![no_std] #[cfg(test)] -#[cfg(not(feature = "std"))] #[macro_use] -extern crate alloc as std; -#[cfg(test)] -#[cfg(feature = "std")] -#[macro_use] -extern crate std; +extern crate alloc; #[macro_use] extern crate cranelift_entity as entity; diff --git a/cranelift/bforest/src/map.rs b/cranelift/bforest/src/map.rs index 3cf8421a30..931253cae5 100644 --- a/cranelift/bforest/src/map.rs +++ b/cranelift/bforest/src/map.rs @@ -231,7 +231,7 @@ where /// Get a text version of the path to `key`. fn tpath>(&self, key: K, forest: &MapForest, comp: &C) -> String { - use std::string::ToString; + use alloc::string::ToString; match self.root.expand() { None => "map(empty)".to_string(), Some(root) => { @@ -420,7 +420,7 @@ where /// Get a text version of the path to the current position. fn tpath(&self) -> String { - use std::string::ToString; + use alloc::string::ToString; self.path.to_string() } } @@ -430,7 +430,7 @@ mod tests { use super::super::NodeData; use super::*; use core::mem; - use std::vec::Vec; + use alloc::vec::Vec; #[test] fn node_size() { diff --git a/cranelift/bforest/src/node.rs b/cranelift/bforest/src/node.rs index f0dbc4d7f5..260494b171 100644 --- a/cranelift/bforest/src/node.rs +++ b/cranelift/bforest/src/node.rs @@ -585,7 +585,7 @@ where mod tests { use super::*; use core::mem; - use std::string::ToString; + use alloc::string::ToString; // Forest impl for a set implementation. struct TF(); diff --git a/cranelift/bforest/src/pool.rs b/cranelift/bforest/src/pool.rs index 0848089eb6..6b4bae020d 100644 --- a/cranelift/bforest/src/pool.rs +++ b/cranelift/bforest/src/pool.rs @@ -86,7 +86,7 @@ impl NodePool { use crate::entity::EntitySet; use core::borrow::Borrow; use core::cmp::Ordering; - use std::vec::Vec; + use alloc::vec::Vec; // The root node can't be an inner node with just a single sub-tree. It should have been // pruned. diff --git a/cranelift/bforest/src/set.rs b/cranelift/bforest/src/set.rs index 72e517561f..d22cb8285e 100644 --- a/cranelift/bforest/src/set.rs +++ b/cranelift/bforest/src/set.rs @@ -6,7 +6,7 @@ use crate::packed_option::PackedOption; use core::fmt; use core::marker::PhantomData; #[cfg(test)] -use std::string::String; +use alloc::string::String; /// Tag type defining forest types for a set. struct SetTypes(PhantomData); @@ -321,7 +321,7 @@ where /// Get a text version of the path to the current position. fn tpath(&self) -> String { - use std::string::ToString; + use alloc::string::ToString; self.path.to_string() } } @@ -358,7 +358,7 @@ mod tests { use super::super::NodeData; use super::*; use core::mem; - use std::vec::Vec; + use alloc::vec::Vec; #[test] fn node_size() { diff --git a/cranelift/codegen/Cargo.toml b/cranelift/codegen/Cargo.toml index e38f06d608..dae5e033c7 100644 --- a/cranelift/codegen/Cargo.toml +++ b/cranelift/codegen/Cargo.toml @@ -15,7 +15,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-bforest = { path = "../cranelift-bforest", version = "0.44.0", default-features = false } +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 } hashbrown = { version = "0.6", optional = true } @@ -39,7 +39,6 @@ default = ["std"] # features need to be enabled. std = [ "cranelift-entity/std", - "cranelift-bforest/std", "cranelift-codegen-meta/std" ]