fix(compiler) Make it work without std.

This patch uses our `lib` module that builds an `std` module depending
of the `core` or `std` feature flag.
This commit is contained in:
Ivan Enderlin
2020-07-23 15:09:46 +02:00
parent 53a13b145d
commit 6df0645ab9
3 changed files with 7 additions and 8 deletions

View File

@@ -38,15 +38,14 @@ extern crate alloc;
mod lib {
#[cfg(feature = "core")]
pub mod std {
#[macro_use]
pub use alloc::{borrow, boxed, string, vec, sync};
pub use alloc::{borrow, boxed, str, string, sync, vec};
pub use core::fmt;
pub use hashbrown as collections;
}
#[cfg(feature = "std")]
pub mod std {
pub use std::{borrow, boxed, collections, fmt, string, sync, vec};
pub use std::{borrow, boxed, collections, fmt, str, string, sync, vec};
}
}
@@ -70,7 +69,7 @@ mod sourceloc;
pub use crate::address_map::{FunctionAddressMap, InstructionAddressMap};
#[cfg(feature = "translator")]
pub use crate::compiler::{Compiler, CompilerConfig};
pub use crate::error::{CompileError, WasmError, WasmResult};
pub use crate::error::{CompileError, ParseCpuFeatureError, WasmError, WasmResult};
pub use crate::function::{
Compilation, CompiledFunction, CompiledFunctionFrameInfo, CustomSections, Dwarf, FunctionBody,
Functions,
@@ -82,7 +81,7 @@ pub use crate::section::{CustomSection, CustomSectionProtection, SectionBody, Se
pub use crate::sourceloc::SourceLoc;
pub use crate::target::{
Architecture, BinaryFormat, CallingConvention, CpuFeature, Endianness, OperatingSystem,
ParseCpuFeatureError, PointerWidth, Target, Triple,
PointerWidth, Target, Triple,
};
#[cfg(feature = "translator")]
pub use crate::translator::{