mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-13 05:48:45 +00:00
Merge branch 'master' into cranelift-update
# Conflicts: # lib/compiler-cranelift/Cargo.toml # lib/compiler-cranelift/src/debug/mod.rs # lib/compiler-cranelift/src/lib.rs # lib/compiler/src/unwind.rs # lib/engine-jit/src/code_memory.rs # lib/engine-jit/src/function_table.rs # lib/engine-jit/src/lib.rs # lib/wasm-common/Cargo.toml
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::{borrow, boxed, string, vec};
|
||||
pub use core::fmt;
|
||||
pub use hashbrown as collections;
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub mod std {
|
||||
pub use std::{borrow, boxed, collections, fmt, string, vec};
|
||||
}
|
||||
}
|
||||
|
||||
mod address_map;
|
||||
#[cfg(feature = "translator")]
|
||||
@@ -66,22 +80,22 @@ pub use crate::relocation::{Relocation, RelocationKind, RelocationTarget, Reloca
|
||||
pub use crate::section::{CustomSection, CustomSectionProtection, SectionBody, SectionIndex};
|
||||
pub use crate::sourceloc::SourceLoc;
|
||||
pub use crate::target::{
|
||||
Architecture, CallingConvention, CpuFeature, OperatingSystem, Target, Triple,
|
||||
Architecture, BinaryFormat, CallingConvention, CpuFeature, OperatingSystem,
|
||||
ParseCpuFeatureError, Target, Triple,
|
||||
};
|
||||
#[cfg(feature = "translator")]
|
||||
pub use crate::translator::{
|
||||
to_wasm_error, translate_module, FunctionBodyData, ModuleEnvironment, ModuleTranslation,
|
||||
ModuleTranslationState,
|
||||
to_wasm_error, translate_module, wptype_to_type, FunctionBodyData, ModuleEnvironment,
|
||||
ModuleInfoTranslation, ModuleTranslationState,
|
||||
};
|
||||
pub use crate::trap::TrapInformation;
|
||||
pub use crate::unwind::CompiledFunctionUnwindInfo;
|
||||
|
||||
pub use wasm_common::Features;
|
||||
|
||||
#[cfg(feature = "translator")]
|
||||
/// wasmparser is exported as a module to slim compiler dependencies
|
||||
pub mod wasmparser {
|
||||
pub use wasmparser::*;
|
||||
}
|
||||
pub use wasmparser;
|
||||
|
||||
/// Offset in bytes from the beginning of the function.
|
||||
pub type CodeOffset = u32;
|
||||
|
||||
Reference in New Issue
Block a user