Skip to content

Change allow(missing_docs) to expect(..) #10384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cranelift/assembler-x64/src/rex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ impl RexFlags {
}

#[derive(Copy, Clone)]
#[allow(missing_docs, reason = "variants are self-explanatory")]
pub enum Imm {
None,
Imm8(i8),
Expand Down
4 changes: 2 additions & 2 deletions cranelift/module/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl From<FuncOrDataId> for ModuleRelocTarget {
feature = "enable-serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct FunctionDeclaration {
pub name: Option<String>,
pub linkage: Linkage,
Expand Down Expand Up @@ -377,7 +377,7 @@ pub type ModuleResult<T> = Result<T, ModuleError>;
feature = "enable-serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct DataDeclaration {
pub name: Option<String>,
pub linkage: Linkage,
Expand Down
2 changes: 1 addition & 1 deletion cranelift/reader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use std::str::FromStr;
use target_lexicon::Triple;

/// Like `FlagsOrIsa`, but holds ownership.
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum OwnedFlagsOrIsa {
Flags(settings::Flags),
Isa(OwnedTargetIsa),
Expand Down
2 changes: 1 addition & 1 deletion cranelift/reader/src/run_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl Display for Invocation {
}

/// A CLIF comparison operation; e.g. `==`.
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
#[derive(Debug, PartialEq)]
pub enum Comparison {
Equals,
Expand Down
2 changes: 1 addition & 1 deletion crates/environ/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ macro_rules! declare_builtin_index_constructors {
$rest_name:ident;
)*
) => {
#[allow(missing_docs, reason = "macro-generated")]
#[expect(missing_docs, reason = "macro-generated")]
pub const fn $this_name() -> Self {
Self($index)
}
Expand Down
10 changes: 5 additions & 5 deletions crates/environ/src/compile/module_environ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub struct FunctionBodyData<'a> {
}

#[derive(Debug, Default)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct DebugInfoData<'a> {
pub dwarf: Dwarf<'a>,
pub name_section: NameSection<'a>,
Expand All @@ -131,21 +131,21 @@ pub struct DebugInfoData<'a> {
pub debug_tu_index: gimli::DebugTuIndex<Reader<'a>>,
}

#[allow(missing_docs, reason = "self-describing")]
#[expect(missing_docs, reason = "self-describing")]
pub type Dwarf<'input> = gimli::Dwarf<Reader<'input>>;

type Reader<'input> = gimli::EndianSlice<'input, gimli::LittleEndian>;

#[derive(Debug, Default)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct NameSection<'a> {
pub module_name: Option<&'a str>,
pub func_names: HashMap<FuncIndex, &'a str>,
pub locals_names: HashMap<FuncIndex, HashMap<u32, &'a str>>,
}

#[derive(Debug, Default)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct WasmFileInfo {
pub path: Option<PathBuf>,
pub code_section_offset: u64,
Expand All @@ -154,7 +154,7 @@ pub struct WasmFileInfo {
}

#[derive(Debug)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct FunctionMetadata {
pub params: Box<[WasmValType]>,
pub locals: Box<[(u32, WasmValType)]>,
Expand Down
22 changes: 11 additions & 11 deletions crates/environ/src/component/dfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub enum SideEffect {
macro_rules! id {
($(pub struct $name:ident(u32);)*) => ($(
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
#[allow(missing_docs, reason = "tedious to document")]
#[expect(missing_docs, reason = "tedious to document")]
pub struct $name(u32);
cranelift_entity::entity_impl!($name);
)*)
Expand All @@ -183,7 +183,7 @@ id! {
}

/// Same as `info::InstantiateModule`
#[allow(missing_docs, reason = "tedious to document variants")]
#[expect(missing_docs, reason = "tedious to document variants")]
pub enum Instance {
Static(StaticModuleIndex, Box<[CoreDef]>),
Import(
Expand All @@ -193,7 +193,7 @@ pub enum Instance {
}

/// Same as `info::Export`
#[allow(missing_docs, reason = "tedious to document variants")]
#[expect(missing_docs, reason = "tedious to document variants")]
pub enum Export {
LiftedFunction {
ty: TypeFuncIndex,
Expand All @@ -217,7 +217,7 @@ pub enum Export {

/// Same as `info::CoreDef`, except has an extra `Adapter` variant.
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
#[allow(missing_docs, reason = "tedious to document variants")]
#[expect(missing_docs, reason = "tedious to document variants")]
pub enum CoreDef {
Export(CoreExport<EntityIndex>),
InstanceFlags(RuntimeComponentInstanceIndex),
Expand All @@ -244,14 +244,14 @@ where

/// Same as `info::CoreExport`
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct CoreExport<T> {
pub instance: InstanceId,
pub item: ExportItem<T>,
}

impl<T> CoreExport<T> {
#[allow(missing_docs, reason = "self-describing function")]
#[expect(missing_docs, reason = "self-describing function")]
pub fn map_index<U>(self, f: impl FnOnce(T) -> U) -> CoreExport<U> {
CoreExport {
instance: self.instance,
Expand All @@ -265,7 +265,7 @@ impl<T> CoreExport<T> {

/// Same as `info::Trampoline`
#[derive(Clone, PartialEq, Eq, Hash)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub enum Trampoline {
LowerImport {
import: RuntimeImportIndex,
Expand Down Expand Up @@ -399,22 +399,22 @@ pub enum Trampoline {
}

#[derive(Copy, Clone, Hash, Eq, PartialEq)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct FutureInfo {
pub instance: RuntimeComponentInstanceIndex,
pub payload_type: Option<InterfaceType>,
}

#[derive(Copy, Clone, Hash, Eq, PartialEq)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct StreamInfo {
pub instance: RuntimeComponentInstanceIndex,
pub payload_type: InterfaceType,
}

/// Same as `info::CanonicalOptions`
#[derive(Clone, Hash, Eq, PartialEq)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct CanonicalOptions {
pub instance: RuntimeComponentInstanceIndex,
pub string_encoding: StringEncoding,
Expand All @@ -426,7 +426,7 @@ pub struct CanonicalOptions {
}

/// Same as `info::Resource`
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct Resource {
pub rep: WasmValType,
pub dtor: Option<CoreDef>,
Expand Down
6 changes: 3 additions & 3 deletions crates/environ/src/component/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ pub struct CanonicalOptions {

/// Possible encodings of strings within the component model.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum StringEncoding {
Utf8,
Utf16,
Expand All @@ -515,7 +515,7 @@ impl StringEncoding {
///
/// Note that each transcoding operation may have a unique signature depending
/// on the precise operation.
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
pub enum Transcode {
Copy(FixedEncoding),
Expand Down Expand Up @@ -571,7 +571,7 @@ impl Transcode {
}

#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum FixedEncoding {
Utf8,
Utf16,
Expand Down
6 changes: 3 additions & 3 deletions crates/environ/src/component/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ pub use crate::{FuncIndex, GlobalIndex, MemoryIndex, TableIndex};
/// Equivalent of `EntityIndex` but for the component model instead of core
/// wasm.
#[derive(Debug, Clone, Copy)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum ComponentItem {
Func(ComponentFuncIndex),
Module(ModuleIndex),
Expand Down Expand Up @@ -546,7 +546,7 @@ pub struct TypeFunc {
/// forms where for non-primitive types a `ComponentTypes` structure is used to
/// lookup further information based on the index found here.
#[derive(Serialize, Deserialize, Copy, Clone, Hash, Eq, PartialEq, Debug)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum InterfaceType {
Bool,
S8,
Expand Down Expand Up @@ -1179,7 +1179,7 @@ impl FlatTypes<'_> {
// regardless to changes in the core wasm type system since this will only
// ever use integers/floats for the foreseeable future.
#[derive(Serialize, Deserialize, Hash, Debug, PartialEq, Eq, Copy, Clone)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum FlatType {
I32,
I64,
Expand Down
2 changes: 1 addition & 1 deletion crates/environ/src/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl GcStructLayout {
#[repr(u32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[rustfmt::skip]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum VMGcKind {
ExternRef = 0b01000 << 27,
AnyRef = 0b10000 << 27,
Expand Down
2 changes: 1 addition & 1 deletion crates/environ/src/module_artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct CompiledFunctionInfo {
/// Information about a function, such as trap information, address map,
/// and stack maps.
#[derive(Serialize, Deserialize, Default)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct WasmFunctionInfo {
pub start_srcloc: FilePos,
pub stack_maps: Box<[StackMapInformation]>,
Expand Down
2 changes: 1 addition & 1 deletion crates/environ/src/obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub const ELF_WASMTIME_DWARF: &str = ".wasmtime.dwarf";
macro_rules! libcalls {
($($rust:ident = $sym:tt)*) => (
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Ord, PartialOrd)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum LibCall {
$($rust,)*
}
Expand Down
2 changes: 1 addition & 1 deletion crates/environ/src/trap_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct TrapInformation {
// These need to be kept in sync.
#[non_exhaustive]
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum Trap {
/// The current stack space was exhausted.
StackOverflow,
Expand Down
2 changes: 1 addition & 1 deletion crates/environ/src/tunables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ macro_rules! define_tunables {

/// Optional tunable configuration options used in `wasmtime::Config`
#[derive(Default, Clone)]
#[allow(missing_docs, reason = "macro-generated fields")]
#[expect(missing_docs, reason = "macro-generated fields")]
pub struct $config_tunables {
$(pub $field: Option<$field_ty>,)*
}
Expand Down
20 changes: 10 additions & 10 deletions crates/environ/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ impl EngineOrModuleTypeIndex {

/// WebAssembly heap type -- equivalent of `wasmparser`'s HeapType
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum WasmHeapType {
// External types.
Extern,
Expand Down Expand Up @@ -964,7 +964,7 @@ impl TypeTrace for WasmStructType {
}

#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[allow(missing_docs, reason = "self-describing type")]
#[expect(missing_docs, reason = "self-describing type")]
pub struct WasmCompositeType {
/// The type defined inside the composite type.
pub inner: WasmCompositeInnerType,
Expand All @@ -988,7 +988,7 @@ impl fmt::Display for WasmCompositeType {

/// A function, array, or struct type.
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum WasmCompositeInnerType {
Array(WasmArrayType),
Func(WasmFuncType),
Expand All @@ -1007,7 +1007,7 @@ impl fmt::Display for WasmCompositeInnerType {
}
}

#[allow(missing_docs, reason = "self-describing functions")]
#[expect(missing_docs, reason = "self-describing functions")]
impl WasmCompositeInnerType {
#[inline]
pub fn is_array(&self) -> bool {
Expand Down Expand Up @@ -1142,7 +1142,7 @@ impl fmt::Display for WasmSubType {
/// Implicitly define all of these helper functions to handle only unshared
/// types; essentially, these act like `is_unshared_*` functions until shared
/// support is implemented.
#[allow(missing_docs, reason = "self-describing functions")]
#[expect(missing_docs, reason = "self-describing functions")]
impl WasmSubType {
#[inline]
pub fn is_func(&self) -> bool {
Expand Down Expand Up @@ -1694,7 +1694,7 @@ impl ConstExpr {
}

/// The subset of Wasm opcodes that are constant.
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
pub enum ConstOp {
I32Const(i32),
Expand Down Expand Up @@ -1780,15 +1780,15 @@ impl ConstOp {

/// The type that can be used to index into [Memory] and [Table].
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[allow(missing_docs, reason = "self-describing variants")]
#[expect(missing_docs, reason = "self-describing variants")]
pub enum IndexType {
I32,
I64,
}

/// The size range of resizeable storage associated with [Memory] types and [Table] types.
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[allow(missing_docs, reason = "self-describing fields")]
#[expect(missing_docs, reason = "self-describing fields")]
pub struct Limits {
pub min: u64,
pub max: Option<u64>,
Expand Down Expand Up @@ -2013,7 +2013,7 @@ impl Memory {
}

#[derive(Copy, Clone, Debug)]
#[allow(missing_docs, reason = "self-describing error struct")]
#[expect(missing_docs, reason = "self-describing error struct")]
pub struct SizeOverflow;

impl fmt::Display for SizeOverflow {
Expand Down Expand Up @@ -2072,7 +2072,7 @@ impl TypeTrace for Tag {
}

/// Helpers used to convert a `wasmparser` type to a type in this crate.
#[allow(missing_docs, reason = "self-describing functions")]
#[expect(missing_docs, reason = "self-describing functions")]
pub trait TypeConvert {
/// Converts a wasmparser table type into a wasmtime type
fn convert_global_type(&self, ty: &wasmparser::GlobalType) -> Global {
Expand Down
2 changes: 1 addition & 1 deletion crates/misc/component-fuzz-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<T, const L: u32, const H: u32> Deref for VecInRange<T, L, H> {
}

/// Represents a component model interface type
#[allow(missing_docs, reason = "self-describing")]
#[expect(missing_docs, reason = "self-describing")]
#[derive(Debug, Clone)]
pub enum Type {
Bool,
Expand Down
2 changes: 1 addition & 1 deletion pulley/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ pub mod operands {
) => {
$(
#[allow(unused_variables, reason = "macro-generated")]
#[allow(missing_docs, reason = "macro-generated")]
#[expect(missing_docs, reason = "macro-generated")]
pub fn $snake_name<T: BytecodeStream>(pc: &mut T) -> Result<($($($field_ty,)*)?), T::Error> {
Ok((($($((<$field_ty>::decode(pc))?,)*)?)))
}
Expand Down
Loading