Remove std feature from cranelift-bforest

This commit is contained in:
bjorn3
2019-09-28 15:39:58 +02:00
committed by Dan Gohman
parent dadfbcd32b
commit d25e611946
7 changed files with 10 additions and 22 deletions

View File

@@ -14,11 +14,6 @@ edition = "2018"
[dependencies] [dependencies]
cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false } cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false }
[features]
default = ["std"]
std = ["cranelift-entity/std"]
core = []
[badges] [badges]
maintenance = { status = "experimental" } maintenance = { status = "experimental" }
travis-ci = { repository = "CraneStation/cranelift" } travis-ci = { repository = "CraneStation/cranelift" }

View File

@@ -15,7 +15,6 @@
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
#![warn(unused_import_braces)] #![warn(unused_import_braces)]
#![cfg_attr(feature = "std", warn(unstable_features))]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))] #![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))] #![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))]
#![cfg_attr( #![cfg_attr(
@@ -34,13 +33,8 @@
#![no_std] #![no_std]
#[cfg(test)] #[cfg(test)]
#[cfg(not(feature = "std"))]
#[macro_use] #[macro_use]
extern crate alloc as std; extern crate alloc;
#[cfg(test)]
#[cfg(feature = "std")]
#[macro_use]
extern crate std;
#[macro_use] #[macro_use]
extern crate cranelift_entity as entity; extern crate cranelift_entity as entity;

View File

@@ -231,7 +231,7 @@ where
/// Get a text version of the path to `key`. /// Get a text version of the path to `key`.
fn tpath<C: Comparator<K>>(&self, key: K, forest: &MapForest<K, V>, comp: &C) -> String { fn tpath<C: Comparator<K>>(&self, key: K, forest: &MapForest<K, V>, comp: &C) -> String {
use std::string::ToString; use alloc::string::ToString;
match self.root.expand() { match self.root.expand() {
None => "map(empty)".to_string(), None => "map(empty)".to_string(),
Some(root) => { Some(root) => {
@@ -420,7 +420,7 @@ where
/// Get a text version of the path to the current position. /// Get a text version of the path to the current position.
fn tpath(&self) -> String { fn tpath(&self) -> String {
use std::string::ToString; use alloc::string::ToString;
self.path.to_string() self.path.to_string()
} }
} }
@@ -430,7 +430,7 @@ mod tests {
use super::super::NodeData; use super::super::NodeData;
use super::*; use super::*;
use core::mem; use core::mem;
use std::vec::Vec; use alloc::vec::Vec;
#[test] #[test]
fn node_size() { fn node_size() {

View File

@@ -585,7 +585,7 @@ where
mod tests { mod tests {
use super::*; use super::*;
use core::mem; use core::mem;
use std::string::ToString; use alloc::string::ToString;
// Forest impl for a set implementation. // Forest impl for a set implementation.
struct TF(); struct TF();

View File

@@ -86,7 +86,7 @@ impl<F: Forest> NodePool<F> {
use crate::entity::EntitySet; use crate::entity::EntitySet;
use core::borrow::Borrow; use core::borrow::Borrow;
use core::cmp::Ordering; 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 // The root node can't be an inner node with just a single sub-tree. It should have been
// pruned. // pruned.

View File

@@ -6,7 +6,7 @@ use crate::packed_option::PackedOption;
use core::fmt; use core::fmt;
use core::marker::PhantomData; use core::marker::PhantomData;
#[cfg(test)] #[cfg(test)]
use std::string::String; use alloc::string::String;
/// Tag type defining forest types for a set. /// Tag type defining forest types for a set.
struct SetTypes<K>(PhantomData<K>); struct SetTypes<K>(PhantomData<K>);
@@ -321,7 +321,7 @@ where
/// Get a text version of the path to the current position. /// Get a text version of the path to the current position.
fn tpath(&self) -> String { fn tpath(&self) -> String {
use std::string::ToString; use alloc::string::ToString;
self.path.to_string() self.path.to_string()
} }
} }
@@ -358,7 +358,7 @@ mod tests {
use super::super::NodeData; use super::super::NodeData;
use super::*; use super::*;
use core::mem; use core::mem;
use std::vec::Vec; use alloc::vec::Vec;
#[test] #[test]
fn node_size() { fn node_size() {

View File

@@ -15,7 +15,7 @@ edition = "2018"
[dependencies] [dependencies]
cranelift-codegen-shared = { path = "./shared", version = "0.44.0" } 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", 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 = { version = "0.1.1", default-features = false, features = ["derive"] }
failure_derive = { version = "0.1.1", default-features = false } failure_derive = { version = "0.1.1", default-features = false }
hashbrown = { version = "0.6", optional = true } hashbrown = { version = "0.6", optional = true }
@@ -39,7 +39,6 @@ default = ["std"]
# features need to be enabled. # features need to be enabled.
std = [ std = [
"cranelift-entity/std", "cranelift-entity/std",
"cranelift-bforest/std",
"cranelift-codegen-meta/std" "cranelift-codegen-meta/std"
] ]