Skip to content

Commit

Permalink
Use allow for missing_docs
Browse files Browse the repository at this point in the history
Work around rust-lang/rust#130021 which was fixed in Rust 1.83 and isn't
fixed for our MSRV at this time.
  • Loading branch information
alexcrichton committed Nov 30, 2024
1 parent 529e149 commit 3fcfdd1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion crates/environ/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ macro_rules! declare_indexes {
)*
) => {
$( #[$this_attr] )*
#[expect(missing_docs, reason = "macro-generated")]
#[allow(missing_docs, reason = "macro-generated")]
pub const fn $this_name() -> Self {
Self($index)
}
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 @@ -328,7 +328,7 @@ impl GcStructLayout {
#[repr(u32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[rustfmt::skip]
#[expect(missing_docs, reason = "self-describing variants")]
#[allow(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/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! the translation the base addresses of regions of memory that will hold the globals, tables and
//! linear memories.
#![deny(missing_docs)]
#![deny(missing_docs, warnings)]
#![warn(clippy::cast_sign_loss)]
#![no_std]

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)]
#[expect(missing_docs, reason = "self-describing fields")]
#[allow(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 @@ -138,7 +138,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)]
#[expect(missing_docs, reason = "self-describing variants")]
#[allow(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)]
#[expect(missing_docs, reason = "self-describing variants")]
#[allow(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 @@ -27,7 +27,7 @@ macro_rules! define_tunables {

/// Optional tunable configuration options used in `wasmtime::Config`
#[derive(Default, Clone)]
#[expect(missing_docs, reason = "macro-generated fields")]
#[allow(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 @@ -405,7 +405,7 @@ impl EngineOrModuleTypeIndex {

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

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

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

#[expect(missing_docs, reason = "self-describing functions")]
#[allow(missing_docs, reason = "self-describing functions")]
impl WasmCompositeInnerType {
#[inline]
pub fn is_array(&self) -> bool {
Expand Down Expand Up @@ -1042,7 +1042,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.
#[expect(missing_docs, reason = "self-describing functions")]
#[allow(missing_docs, reason = "self-describing functions")]
impl WasmSubType {
#[inline]
pub fn is_func(&self) -> bool {
Expand Down Expand Up @@ -1559,7 +1559,7 @@ impl ConstExpr {
}

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

/// The type that can be used to index into [Memory] and [Table].
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[expect(missing_docs, reason = "self-describing variants")]
#[allow(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)]
#[expect(missing_docs, reason = "self-describing fields")]
#[allow(missing_docs, reason = "self-describing fields")]
pub struct Limits {
pub min: u64,
pub max: Option<u64>,
Expand Down Expand Up @@ -1878,7 +1878,7 @@ impl Memory {
}

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

impl fmt::Display for SizeOverflow {
Expand Down Expand Up @@ -1932,7 +1932,7 @@ impl From<wasmparser::TagType> for Tag {
}

/// Helpers used to convert a `wasmparser` type to a type in this crate.
#[expect(missing_docs, reason = "self-describing functions")]
#[allow(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

0 comments on commit 3fcfdd1

Please sign in to comment.