diff --git a/lib/api/src/externals/memory.rs b/lib/api/src/externals/memory.rs index c83e324c3..423345a27 100644 --- a/lib/api/src/externals/memory.rs +++ b/lib/api/src/externals/memory.rs @@ -32,9 +32,8 @@ pub struct Memory { impl Memory { /// Creates a new host `Memory` from the provided [`MemoryType`]. /// - /// This function will construct the `Memory` using the store [`Tunables`]. - /// - /// [`Tunables`]: crate::tunables::Tunables + /// This function will construct the `Memory` using the store + /// [`BaseTunables`][crate::tunables::BaseTunables]. /// /// # Example /// diff --git a/lib/api/src/externals/table.rs b/lib/api/src/externals/table.rs index 838cb1b21..8e2f43696 100644 --- a/lib/api/src/externals/table.rs +++ b/lib/api/src/externals/table.rs @@ -36,9 +36,8 @@ impl Table { /// /// All the elements in the table will be set to the `init` value. /// - /// This function will construct the `Table` using the store [`Tunables`]. - /// - /// [`Tunables`]: crate::tunables::Tunables + /// This function will construct the `Table` using the store + /// [`BaseTunables`][crate::tunables::BaseTunables]. pub fn new(store: &Store, ty: TableType, init: Val) -> Result { let item = init.into_checked_anyfunc(store)?; let tunables = store.tunables(); diff --git a/lib/compiler-cranelift/src/config.rs b/lib/compiler-cranelift/src/config.rs index c4f8bdf65..7c6d95577 100644 --- a/lib/compiler-cranelift/src/config.rs +++ b/lib/compiler-cranelift/src/config.rs @@ -22,11 +22,11 @@ pub enum OptLevel { SpeedAndSize, } -/// Global configuration options used to create an [`Engine`] and customize its -/// behavior. +/// Global configuration options used to create an +/// `wasmer_engine::Engine` and customize its behavior. /// -/// This structure exposed a builder-like interface and is primarily consumed by -/// [`Engine::new()`] +/// This structure exposed a builder-like interface and is primarily +/// consumed by `wasmer_engine::Engine::new`. #[derive(Debug, Clone)] pub struct Cranelift { enable_nan_canonicalization: bool, diff --git a/lib/compiler/src/error.rs b/lib/compiler/src/error.rs index 871adf366..d71af0616 100644 --- a/lib/compiler/src/error.rs +++ b/lib/compiler/src/error.rs @@ -80,7 +80,7 @@ pub enum WasmError { } /// The error that can happen while parsing a `str` -/// to retrieve a [`CpuFeature`]. +/// to retrieve a [`CpuFeature`](crate::target::CpuFeature). #[derive(Debug)] #[cfg_attr(feature = "std", derive(Error))] pub enum ParseCpuFeatureError { diff --git a/lib/compiler/src/function.rs b/lib/compiler/src/function.rs index d18be804e..6be0ae9ac 100644 --- a/lib/compiler/src/function.rs +++ b/lib/compiler/src/function.rs @@ -82,8 +82,8 @@ pub type CustomSections = PrimaryMap; #[derive(Debug, PartialEq, Eq, Clone)] pub struct Dwarf { /// The section index in the [`Compilation`] that corresponds to the exception frames. - /// More info: - /// https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html + /// [Learn + /// more](https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/ehframechpt.html). pub eh_frame: SectionIndex, } diff --git a/lib/compiler/src/jump_table.rs b/lib/compiler/src/jump_table.rs index 1ec2becdf..19da678c7 100644 --- a/lib/compiler/src/jump_table.rs +++ b/lib/compiler/src/jump_table.rs @@ -2,7 +2,7 @@ //! to another part of a program (or a different program that may have //! been dynamically loaded) using a table of branch or jump instructions. //! -//! Source: https://en.wikipedia.org/wiki/Branch_table +//! [Learn more](https://en.wikipedia.org/wiki/Branch_table). use super::CodeOffset; #[cfg(feature = "enable-serde")] diff --git a/lib/compiler/src/relocation.rs b/lib/compiler/src/relocation.rs index ec1b081ee..c0e6306ed 100644 --- a/lib/compiler/src/relocation.rs +++ b/lib/compiler/src/relocation.rs @@ -2,7 +2,7 @@ //! code and data of a program and adjusting the code and data to reflect the //! assigned addresses. //! -//! Source: https://en.wikipedia.org/wiki/Relocation_(computing) +//! [Learn more](https://en.wikipedia.org/wiki/Relocation_(computing)). //! //! Each time a `Compiler` compiles a WebAssembly function (into machine code), //! it also attaches if there are any relocations that need to be patched into diff --git a/lib/compiler/src/unwind.rs b/lib/compiler/src/unwind.rs index 380d2f8b4..309492814 100644 --- a/lib/compiler/src/unwind.rs +++ b/lib/compiler/src/unwind.rs @@ -4,7 +4,7 @@ //! called the function that threw the exception, and which //! function called that one, and so forth. //! -//! More info: https://en.wikipedia.org/wiki/Call_stack +//! [Learn more](https://en.wikipedia.org/wiki/Call_stack). use crate::lib::std::vec::Vec; #[cfg(feature = "enable-serde")] use serde::{Deserialize, Serialize}; diff --git a/lib/engine/src/trap/frame_info.rs b/lib/engine/src/trap/frame_info.rs index f929f39ff..8906a4478 100644 --- a/lib/engine/src/trap/frame_info.rs +++ b/lib/engine/src/trap/frame_info.rs @@ -292,13 +292,14 @@ pub fn register( Some(GlobalFrameInfoRegistration { key: max }) } -/// Description of a frame in a backtrace for a [`Trap`]. +/// Description of a frame in a backtrace for a [`RuntimeError::trace`](crate::RuntimeError::trace). /// -/// Whenever a WebAssembly trap occurs an instance of [`Trap`] is created. Each -/// [`Trap`] has a backtrace of the WebAssembly frames that led to the trap, and -/// each frame is described by this structure. +/// Whenever a WebAssembly trap occurs an instance of [`RuntimeError`] +/// is created. Each [`RuntimeError`] has a backtrace of the +/// WebAssembly frames that led to the trap, and each frame is +/// described by this structure. /// -/// [`Trap`]: crate::Trap +/// [`RuntimeError`]: crate::RuntimeError #[derive(Debug, Clone)] pub struct FrameInfo { module_name: String, diff --git a/lib/vm/src/instance/allocator.rs b/lib/vm/src/instance/allocator.rs index 50da00b53..fa2618fac 100644 --- a/lib/vm/src/instance/allocator.rs +++ b/lib/vm/src/instance/allocator.rs @@ -65,6 +65,8 @@ impl InstanceAllocator { /// correspond to the location in memory for the local memories and /// tables respectively. These pointers should be written to before /// calling [`InstanceHandle::new`]. + /// + /// [`InstanceHandle::new`]: super::InstanceHandle::new pub fn new( module: &ModuleInfo, ) -> ( diff --git a/lib/vm/src/module.rs b/lib/vm/src/module.rs index 47f48b5d0..79bb1b418 100644 --- a/lib/vm/src/module.rs +++ b/lib/vm/src/module.rs @@ -1,8 +1,8 @@ // This file contains code from external sources. // Attributions: https://github.com/wasmerio/wasmer/blob/master/ATTRIBUTIONS.md -//! Data structure for representing WebAssembly modules -//! in a [`Module`]. +//! Data structure for representing WebAssembly modules in a +//! `wasmer::Module`. use indexmap::IndexMap; use serde::{Deserialize, Serialize}; diff --git a/lib/vm/src/vmcontext.rs b/lib/vm/src/vmcontext.rs index 4f4784854..a919c8f49 100644 --- a/lib/vm/src/vmcontext.rs +++ b/lib/vm/src/vmcontext.rs @@ -164,7 +164,7 @@ mod test_vmfunction_body { #[repr(C)] pub enum VMFunctionKind { /// A static function has the native signature: - /// extern "C" (vmctx, arg1, arg2...) -> (result1, result2, ...) + /// `extern "C" (vmctx, arg1, arg2...) -> (result1, result2, ...)`. /// /// This is the default for functions that are defined: /// 1. In the Host, natively @@ -172,7 +172,7 @@ pub enum VMFunctionKind { Static, /// A dynamic function has the native signature: - /// extern "C" (ctx, &[Value]) -> Vec + /// `extern "C" (ctx, &[Value]) -> Vec`. /// /// This is the default for functions that are defined: /// 1. In the Host, dynamically diff --git a/lib/wasi/src/state/mod.rs b/lib/wasi/src/state/mod.rs index 15dca18d1..eddc679e3 100644 --- a/lib/wasi/src/state/mod.rs +++ b/lib/wasi/src/state/mod.rs @@ -1,6 +1,6 @@ //! WARNING: the API exposed here is unstable and very experimental. Certain things are not ready //! yet and may be broken in patch releases. If you're using this and have any specific needs, -//! please let us know here https://github.com/wasmerio/wasmer/issues/583 or by filing an issue. +//! please [let us know here](https://github.com/wasmerio/wasmer/issues/583) or by filing an issue. //! //! Wasmer always has a virtual root directory located at `/` at which all pre-opened directories can //! be found. It's possible to traverse between preopened directories this way as well (for example @@ -539,7 +539,7 @@ impl WasiFs { /// # Safety /// - Virtual directories created with this function must not conflict with /// the standard operation of the WASI filesystem. This is vague and - /// unlikely in pratice. Join the discussion at https://github.com/wasmerio/wasmer/issues/1219 + /// unlikely in pratice. [Join the discussion](https://github.com/wasmerio/wasmer/issues/1219) /// for what the newer, safer WASI FS APIs should look like. #[allow(dead_code)] pub unsafe fn open_dir_all( diff --git a/lib/wasmer-types/src/types.rs b/lib/wasmer-types/src/types.rs index 725370e1a..37eb7846d 100644 --- a/lib/wasmer-types/src/types.rs +++ b/lib/wasmer-types/src/types.rs @@ -359,9 +359,9 @@ pub struct GlobalType { /// A WebAssembly global descriptor. /// -/// This type describes an instance of a global in a WebAssembly module. Globals -/// are local to an [`Instance`](crate::Instance) and are either immutable or -/// mutable. +/// This type describes an instance of a global in a WebAssembly +/// module. Globals are local to an `Instance` and are either +/// immutable or mutable. impl GlobalType { /// Create a new Global variable /// # Usage: @@ -520,10 +520,10 @@ impl fmt::Display for MemoryType { /// A descriptor for an imported value into a wasm module. /// -/// This type is primarily accessed from the -/// [`Module::imports`](crate::Module::imports) API. Each [`ImportType`] -/// describes an import into the wasm module with the module/name that it's -/// imported from as well as the type of item that's being imported. +/// This type is primarily accessed from the `Module::imports` +/// API. Each `ImportType` describes an import into the wasm module +/// with the module/name that it's imported from as well as the type +/// of item that's being imported. #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] pub struct ImportType { @@ -564,10 +564,9 @@ impl ImportType { /// A descriptor for an exported WebAssembly value. /// -/// This type is primarily accessed from the -/// [`Module::exports`](crate::Module::exports) accessor and describes what -/// names are exported from a wasm module and the type of the item that is -/// exported. +/// This type is primarily accessed from the `Module::exports` +/// accessor and describes what names are exported from a wasm module +/// and the type of the item that is exported. /// /// The `` refefers to `ExternType`, however it can also refer to use /// `MemoryType`, `TableType`, `FunctionType` and `GlobalType` for ease of