Skip to content

Commit d86901b

Browse files
authored
Change allow(missing_docs) to expect(..) (#10384)
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 800454b commit d86901b

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
@@ -119,7 +119,6 @@ impl RexFlags {
119119
}
120120

121121
#[derive(Copy, Clone)]
122-
#[allow(missing_docs, reason = "variants are self-explanatory")]
123122
pub enum Imm {
124123
None,
125124
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,

0 commit comments

Comments
 (0)