1#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
9#![warn(unused_import_braces)]
10#![cfg_attr(feature = "std", deny(unstable_features))]
11#![cfg_attr(not(feature = "std"), no_std)]
12#![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))]
13#![cfg_attr(
14 feature = "cargo-clippy",
15 warn(
16 clippy::float_arithmetic,
17 clippy::mut_mut,
18 clippy::nonminimal_bool,
19 clippy::option_map_unwrap_or,
20 clippy::option_map_unwrap_or_else,
21 clippy::print_stdout,
22 clippy::unicode_not_nfc,
23 clippy::use_self
24 )
25)]
26
27#[cfg(all(feature = "std", feature = "core"))]
28compile_error!(
29 "The `std` and `core` features are both enabled, which is an error. Please enable only once."
30);
31
32#[cfg(all(not(feature = "std"), not(feature = "core")))]
33compile_error!("Both the `std` and `core` features are disabled. Please enable one of them.");
34
35#[cfg(feature = "core")]
36extern crate alloc;
37
38mod lib {
39 #[cfg(feature = "core")]
40 pub mod std {
41 pub use alloc::{borrow, boxed, str, string, sync, vec};
42 pub use core::fmt;
43 pub use hashbrown as collections;
44 }
45
46 #[cfg(feature = "std")]
47 pub mod std {
48 pub use std::{borrow, boxed, collections, fmt, str, string, sync, vec};
49 }
50}
51
52mod address_map;
53#[cfg(feature = "translator")]
54mod compiler;
55mod error;
56mod function;
57mod jump_table;
58mod module;
59mod relocation;
60mod target;
61mod trap;
62mod unwind;
63#[cfg(feature = "translator")]
64#[macro_use]
65mod translator;
66mod section;
67mod sourceloc;
68
69pub use crate::address_map::{FunctionAddressMap, InstructionAddressMap};
70#[cfg(feature = "translator")]
71pub use crate::compiler::{Compiler, CompilerConfig, Symbol, SymbolRegistry};
72pub use crate::error::{
73 CompileError, MiddlewareError, ParseCpuFeatureError, WasmError, WasmResult,
74};
75pub use crate::function::{
76 Compilation, CompiledFunction, CompiledFunctionFrameInfo, CustomSections, Dwarf, FunctionBody,
77 FunctionBodyRef, Functions, TrampolinesSection,
78};
79pub use crate::jump_table::{JumpTable, JumpTableOffsets};
80pub use crate::module::CompileModuleInfo;
81pub use crate::relocation::{Relocation, RelocationKind, RelocationTarget, Relocations};
82pub use crate::section::{
83 CustomSection, CustomSectionProtection, CustomSectionRef, SectionBody, SectionIndex,
84};
85pub use crate::sourceloc::SourceLoc;
86pub use crate::target::{
87 Architecture, BinaryFormat, CallingConvention, CpuFeature, Endianness, OperatingSystem,
88 PointerWidth, Target, Triple,
89};
90#[cfg(feature = "translator")]
91pub use crate::translator::{
92 translate_module, wptype_to_type, FunctionBodyData, FunctionReader, ModuleEnvironment,
93 ModuleTranslationState,
94};
95pub use crate::trap::TrapInformation;
96pub use crate::unwind::{CompiledFunctionUnwindInfo, CompiledFunctionUnwindInfoRef};
97
98pub use wasmer_types::Features;
99
100#[cfg(feature = "translator")]
101pub use wasmparser;
103
104pub type CodeOffset = u32;
106
107pub type Addend = i64;
109
110pub const VERSION: &str = env!("CARGO_PKG_VERSION");