Skip to content

Commit 0fcb767

Browse files
committed
Change allow(missing_docs) to expect(..)
This wasn't possible when `expect` was first introduced due to a change being required in upstream rust-lang/rust. That change rust-lang/rust#130025) has now rode enough trains to be in our MSRV, so we can expect missing docs now instead of just allowing it.
1 parent 944ae82 commit 0fcb767

File tree

22 files changed

+56
-57
lines changed

22 files changed

+56
-57
lines changed

cranelift/assembler-x64/src/rex.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ impl RexFlags {
121121
}
122122

123123
#[derive(Copy, Clone)]
124-
#[allow(missing_docs, reason = "variants are self-explanatory")]
125124
pub enum Imm {
126125
None,
127126
Imm8(i8),

cranelift/module/src/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl From<FuncOrDataId> for ModuleRelocTarget {
220220
feature = "enable-serde",
221221
derive(serde_derive::Serialize, serde_derive::Deserialize)
222222
)]
223-
#[allow(missing_docs, reason = "self-describing fields")]
223+
#[expect(missing_docs, reason = "self-describing fields")]
224224
pub struct FunctionDeclaration {
225225
pub name: Option<String>,
226226
pub linkage: Linkage,
@@ -377,7 +377,7 @@ pub type ModuleResult<T> = Result<T, ModuleError>;
377377
feature = "enable-serde",
378378
derive(serde_derive::Serialize, serde_derive::Deserialize)
379379
)]
380-
#[allow(missing_docs, reason = "self-describing fields")]
380+
#[expect(missing_docs, reason = "self-describing fields")]
381381
pub struct DataDeclaration {
382382
pub name: Option<String>,
383383
pub linkage: Linkage,

cranelift/reader/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::str::FromStr;
2929
use target_lexicon::Triple;
3030

3131
/// Like `FlagsOrIsa`, but holds ownership.
32-
#[allow(missing_docs, reason = "self-describing variants")]
32+
#[expect(missing_docs, reason = "self-describing variants")]
3333
pub enum OwnedFlagsOrIsa {
3434
Flags(settings::Flags),
3535
Isa(OwnedTargetIsa),

cranelift/reader/src/run_command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl Display for Invocation {
105105
}
106106

107107
/// A CLIF comparison operation; e.g. `==`.
108-
#[allow(missing_docs, reason = "self-describing variants")]
108+
#[expect(missing_docs, reason = "self-describing variants")]
109109
#[derive(Debug, PartialEq)]
110110
pub enum Comparison {
111111
Equals,

crates/environ/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ macro_rules! declare_builtin_index_constructors {
285285
$rest_name:ident;
286286
)*
287287
) => {
288-
#[allow(missing_docs, reason = "macro-generated")]
288+
#[expect(missing_docs, reason = "macro-generated")]
289289
pub const fn $this_name() -> Self {
290290
Self($index)
291291
}

crates/environ/src/compile/module_environ.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub struct FunctionBodyData<'a> {
118118
}
119119

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

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

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

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

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

156156
#[derive(Debug)]
157-
#[allow(missing_docs, reason = "self-describing fields")]
157+
#[expect(missing_docs, reason = "self-describing fields")]
158158
pub struct FunctionMetadata {
159159
pub params: Box<[WasmValType]>,
160160
pub locals: Box<[(u32, WasmValType)]>,

crates/environ/src/component/dfg.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub enum SideEffect {
166166
macro_rules! id {
167167
($(pub struct $name:ident(u32);)*) => ($(
168168
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
169-
#[allow(missing_docs, reason = "tedious to document")]
169+
#[expect(missing_docs, reason = "tedious to document")]
170170
pub struct $name(u32);
171171
cranelift_entity::entity_impl!($name);
172172
)*)
@@ -183,7 +183,7 @@ id! {
183183
}
184184

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

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

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

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

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

266266
/// Same as `info::Trampoline`
267267
#[derive(Clone, PartialEq, Eq, Hash)]
268-
#[allow(missing_docs, reason = "self-describing fields")]
268+
#[expect(missing_docs, reason = "self-describing fields")]
269269
pub enum Trampoline {
270270
LowerImport {
271271
import: RuntimeImportIndex,
@@ -399,22 +399,22 @@ pub enum Trampoline {
399399
}
400400

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

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

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

428428
/// Same as `info::Resource`
429-
#[allow(missing_docs, reason = "self-describing fields")]
429+
#[expect(missing_docs, reason = "self-describing fields")]
430430
pub struct Resource {
431431
pub rep: WasmValType,
432432
pub dtor: Option<CoreDef>,

crates/environ/src/component/info.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ pub struct CanonicalOptions {
488488

489489
/// Possible encodings of strings within the component model.
490490
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
491-
#[allow(missing_docs, reason = "self-describing variants")]
491+
#[expect(missing_docs, reason = "self-describing variants")]
492492
pub enum StringEncoding {
493493
Utf8,
494494
Utf16,
@@ -515,7 +515,7 @@ impl StringEncoding {
515515
///
516516
/// Note that each transcoding operation may have a unique signature depending
517517
/// on the precise operation.
518-
#[allow(missing_docs, reason = "self-describing variants")]
518+
#[expect(missing_docs, reason = "self-describing variants")]
519519
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
520520
pub enum Transcode {
521521
Copy(FixedEncoding),
@@ -571,7 +571,7 @@ impl Transcode {
571571
}
572572

573573
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize)]
574-
#[allow(missing_docs, reason = "self-describing variants")]
574+
#[expect(missing_docs, reason = "self-describing variants")]
575575
pub enum FixedEncoding {
576576
Utf8,
577577
Utf16,

crates/environ/src/component/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub use crate::{FuncIndex, GlobalIndex, MemoryIndex, TableIndex};
241241
/// Equivalent of `EntityIndex` but for the component model instead of core
242242
/// wasm.
243243
#[derive(Debug, Clone, Copy)]
244-
#[allow(missing_docs, reason = "self-describing variants")]
244+
#[expect(missing_docs, reason = "self-describing variants")]
245245
pub enum ComponentItem {
246246
Func(ComponentFuncIndex),
247247
Module(ModuleIndex),
@@ -546,7 +546,7 @@ pub struct TypeFunc {
546546
/// forms where for non-primitive types a `ComponentTypes` structure is used to
547547
/// lookup further information based on the index found here.
548548
#[derive(Serialize, Deserialize, Copy, Clone, Hash, Eq, PartialEq, Debug)]
549-
#[allow(missing_docs, reason = "self-describing variants")]
549+
#[expect(missing_docs, reason = "self-describing variants")]
550550
pub enum InterfaceType {
551551
Bool,
552552
S8,
@@ -1179,7 +1179,7 @@ impl FlatTypes<'_> {
11791179
// regardless to changes in the core wasm type system since this will only
11801180
// ever use integers/floats for the foreseeable future.
11811181
#[derive(Serialize, Deserialize, Hash, Debug, PartialEq, Eq, Copy, Clone)]
1182-
#[allow(missing_docs, reason = "self-describing variants")]
1182+
#[expect(missing_docs, reason = "self-describing variants")]
11831183
pub enum FlatType {
11841184
I32,
11851185
I64,

crates/environ/src/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ impl GcStructLayout {
325325
#[repr(u32)]
326326
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
327327
#[rustfmt::skip]
328-
#[allow(missing_docs, reason = "self-describing variants")]
328+
#[expect(missing_docs, reason = "self-describing variants")]
329329
pub enum VMGcKind {
330330
ExternRef = 0b01000 << 27,
331331
AnyRef = 0b10000 << 27,

crates/environ/src/module_artifacts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct CompiledFunctionInfo {
2525
/// Information about a function, such as trap information, address map,
2626
/// and stack maps.
2727
#[derive(Serialize, Deserialize, Default)]
28-
#[allow(missing_docs, reason = "self-describing fields")]
28+
#[expect(missing_docs, reason = "self-describing fields")]
2929
pub struct WasmFunctionInfo {
3030
pub start_srcloc: FilePos,
3131
pub stack_maps: Box<[StackMapInformation]>,

crates/environ/src/obj.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub const ELF_WASMTIME_DWARF: &str = ".wasmtime.dwarf";
140140
macro_rules! libcalls {
141141
($($rust:ident = $sym:tt)*) => (
142142
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Ord, PartialOrd)]
143-
#[allow(missing_docs, reason = "self-describing variants")]
143+
#[expect(missing_docs, reason = "self-describing variants")]
144144
pub enum LibCall {
145145
$($rust,)*
146146
}

crates/environ/src/trap_encoding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub struct TrapInformation {
2222
// These need to be kept in sync.
2323
#[non_exhaustive]
2424
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
25-
#[allow(missing_docs, reason = "self-describing variants")]
25+
#[expect(missing_docs, reason = "self-describing variants")]
2626
pub enum Trap {
2727
/// The current stack space was exhausted.
2828
StackOverflow,

crates/environ/src/tunables.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ macro_rules! define_tunables {
2828

2929
/// Optional tunable configuration options used in `wasmtime::Config`
3030
#[derive(Default, Clone)]
31-
#[allow(missing_docs, reason = "macro-generated fields")]
31+
#[expect(missing_docs, reason = "macro-generated fields")]
3232
pub struct $config_tunables {
3333
$(pub $field: Option<$field_ty>,)*
3434
}

crates/environ/src/types.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ impl EngineOrModuleTypeIndex {
425425

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

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

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

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

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

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

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

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

20192019
impl fmt::Display for SizeOverflow {
@@ -2072,7 +2072,7 @@ impl TypeTrace for Tag {
20722072
}
20732073

20742074
/// Helpers used to convert a `wasmparser` type to a type in this crate.
2075-
#[allow(missing_docs, reason = "self-describing functions")]
2075+
#[expect(missing_docs, reason = "self-describing functions")]
20762076
pub trait TypeConvert {
20772077
/// Converts a wasmparser table type into a wasmtime type
20782078
fn convert_global_type(&self, ty: &wasmparser::GlobalType) -> Global {

crates/misc/component-fuzz-util/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<T, const L: u32, const H: u32> Deref for VecInRange<T, L, H> {
9393
}
9494

9595
/// Represents a component model interface type
96-
#[allow(missing_docs, reason = "self-describing")]
96+
#[expect(missing_docs, reason = "self-describing")]
9797
#[derive(Debug, Clone)]
9898
pub enum Type {
9999
Bool,

pulley/src/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ pub mod operands {
771771
) => {
772772
$(
773773
#[allow(unused_variables, reason = "macro-generated")]
774-
#[allow(missing_docs, reason = "macro-generated")]
774+
#[expect(missing_docs, reason = "macro-generated")]
775775
pub fn $snake_name<T: BytecodeStream>(pc: &mut T) -> Result<($($($field_ty,)*)?), T::Error> {
776776
Ok((($($((<$field_ty>::decode(pc))?,)*)?)))
777777
}

0 commit comments

Comments
 (0)