mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-12 21:38:39 +00:00
Merge pull request #32 from Hywan/fix-compiler-no-default-features
fix(compiler) Fix features
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
|
||||
#![warn(unused_import_braces)]
|
||||
#![cfg_attr(feature = "std", deny(unstable_features))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))]
|
||||
#![cfg_attr(
|
||||
@@ -23,19 +24,32 @@
|
||||
clippy::use_self
|
||||
)
|
||||
)]
|
||||
#![no_std]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
#[macro_use]
|
||||
extern crate alloc as std;
|
||||
#[cfg(feature = "std")]
|
||||
#[macro_use]
|
||||
extern crate std;
|
||||
#[cfg(all(feature = "std", feature = "core"))]
|
||||
compile_error!(
|
||||
"The `std` and `core` features are both enabled, which is an error. Please enable only once."
|
||||
);
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use hashbrown::HashMap;
|
||||
#[cfg(feature = "std")]
|
||||
use std::collections::HashMap;
|
||||
#[cfg(all(not(feature = "std"), not(feature = "core")))]
|
||||
compile_error!("Both the `std` and `core` features are disabled. Please enable one of them.");
|
||||
|
||||
#[cfg(feature = "core")]
|
||||
extern crate alloc;
|
||||
|
||||
mod lib {
|
||||
#[cfg(feature = "core")]
|
||||
pub mod std {
|
||||
#[macro_use]
|
||||
pub use alloc::{boxed, string, vec};
|
||||
pub use core::fmt;
|
||||
pub use hashbrown as collections;
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub mod std {
|
||||
pub use std::{boxed, collections, fmt, string, vec};
|
||||
}
|
||||
}
|
||||
|
||||
mod address_map;
|
||||
#[cfg(feature = "translator")]
|
||||
|
||||
Reference in New Issue
Block a user