@@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
11
11
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
12
12
/// about the language items in the local crate, as well as info about external items to allow
13
13
/// tools to find or link to them.
14
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
14
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
15
15
pub struct Crate {
16
16
/// The id of the root [`Module`] item of the local crate.
17
17
pub root : Id ,
@@ -31,7 +31,7 @@ pub struct Crate {
31
31
pub format_version : u32 ,
32
32
}
33
33
34
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
34
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
35
35
pub struct ExternalCrate {
36
36
pub name : String ,
37
37
pub html_root_url : Option < String > ,
@@ -41,7 +41,7 @@ pub struct ExternalCrate {
41
41
/// information. This struct should contain enough to generate a link/reference to the item in
42
42
/// question, or can be used by a tool that takes the json output of multiple crates to find
43
43
/// the actual item definition with all the relevant info.
44
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
44
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
45
45
pub struct ItemSummary {
46
46
/// Can be used to look up the name and html_root_url of the crate this item came from in the
47
47
/// `external_crates` map.
@@ -53,7 +53,7 @@ pub struct ItemSummary {
53
53
pub kind : ItemKind ,
54
54
}
55
55
56
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
56
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
57
57
pub struct Item {
58
58
/// The unique identifier of this item. Can be used to find this item in various mappings.
59
59
pub id : Id ,
@@ -79,7 +79,7 @@ pub struct Item {
79
79
pub inner : ItemEnum ,
80
80
}
81
81
82
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
82
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
83
83
pub struct Span {
84
84
/// The path to the source file for this span relative to the path `rustdoc` was invoked with.
85
85
pub filename : PathBuf ,
@@ -89,14 +89,14 @@ pub struct Span {
89
89
pub end : ( usize , usize ) ,
90
90
}
91
91
92
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
92
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
93
93
pub struct Deprecation {
94
94
pub since : Option < String > ,
95
95
pub note : Option < String > ,
96
96
}
97
97
98
98
#[ serde( rename_all = "snake_case" ) ]
99
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
99
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
100
100
pub enum Visibility {
101
101
Public ,
102
102
/// For the most part items are private by default. The exceptions are associated items of
@@ -112,7 +112,7 @@ pub enum Visibility {
112
112
}
113
113
114
114
#[ serde( rename_all = "snake_case" ) ]
115
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
115
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
116
116
pub enum GenericArgs {
117
117
/// <'a, 32, B: Copy, C = u32>
118
118
AngleBracketed { args : Vec < GenericArg > , bindings : Vec < TypeBinding > } ,
@@ -121,14 +121,14 @@ pub enum GenericArgs {
121
121
}
122
122
123
123
#[ serde( rename_all = "snake_case" ) ]
124
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
124
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
125
125
pub enum GenericArg {
126
126
Lifetime ( String ) ,
127
127
Type ( Type ) ,
128
128
Const ( Constant ) ,
129
129
}
130
130
131
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
131
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
132
132
pub struct Constant {
133
133
#[ serde( rename = "type" ) ]
134
134
pub type_ : Type ,
@@ -137,14 +137,14 @@ pub struct Constant {
137
137
pub is_literal : bool ,
138
138
}
139
139
140
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
140
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
141
141
pub struct TypeBinding {
142
142
pub name : String ,
143
143
pub binding : TypeBindingKind ,
144
144
}
145
145
146
146
#[ serde( rename_all = "snake_case" ) ]
147
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
147
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
148
148
pub enum TypeBindingKind {
149
149
Equality ( Type ) ,
150
150
Constraint ( Vec < GenericBound > ) ,
@@ -154,7 +154,7 @@ pub enum TypeBindingKind {
154
154
pub struct Id ( pub String ) ;
155
155
156
156
#[ serde( rename_all = "snake_case" ) ]
157
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
157
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
158
158
pub enum ItemKind {
159
159
Module ,
160
160
ExternCrate ,
@@ -184,7 +184,7 @@ pub enum ItemKind {
184
184
}
185
185
186
186
#[ serde( untagged) ]
187
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
187
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
188
188
pub enum ItemEnum {
189
189
ModuleItem ( Module ) ,
190
190
ExternCrateItem {
@@ -231,13 +231,13 @@ pub enum ItemEnum {
231
231
} ,
232
232
}
233
233
234
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
234
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
235
235
pub struct Module {
236
236
pub is_crate : bool ,
237
237
pub items : Vec < Id > ,
238
238
}
239
239
240
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
240
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
241
241
pub struct Struct {
242
242
pub struct_type : StructType ,
243
243
pub generics : Generics ,
@@ -246,7 +246,7 @@ pub struct Struct {
246
246
pub impls : Vec < Id > ,
247
247
}
248
248
249
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
249
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
250
250
pub struct Enum {
251
251
pub generics : Generics ,
252
252
pub variants_stripped : bool ,
@@ -256,67 +256,67 @@ pub struct Enum {
256
256
257
257
#[ serde( rename_all = "snake_case" ) ]
258
258
#[ serde( tag = "variant_kind" , content = "variant_inner" ) ]
259
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
259
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
260
260
pub enum Variant {
261
261
Plain ,
262
262
Tuple ( Vec < Type > ) ,
263
263
Struct ( Vec < Id > ) ,
264
264
}
265
265
266
266
#[ serde( rename_all = "snake_case" ) ]
267
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
267
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
268
268
pub enum StructType {
269
269
Plain ,
270
270
Tuple ,
271
271
Unit ,
272
272
}
273
273
274
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
274
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
275
275
pub struct Function {
276
276
pub decl : FnDecl ,
277
277
pub generics : Generics ,
278
278
pub header : String ,
279
279
pub abi : String ,
280
280
}
281
281
282
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
282
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
283
283
pub struct Method {
284
284
pub decl : FnDecl ,
285
285
pub generics : Generics ,
286
286
pub header : String ,
287
287
pub has_body : bool ,
288
288
}
289
289
290
- #[ derive( Clone , Debug , Default , Serialize , Deserialize ) ]
290
+ #[ derive( Clone , Debug , Default , Serialize , Deserialize , PartialEq ) ]
291
291
pub struct Generics {
292
292
pub params : Vec < GenericParamDef > ,
293
293
pub where_predicates : Vec < WherePredicate > ,
294
294
}
295
295
296
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
296
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
297
297
pub struct GenericParamDef {
298
298
pub name : String ,
299
299
pub kind : GenericParamDefKind ,
300
300
}
301
301
302
302
#[ serde( rename_all = "snake_case" ) ]
303
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
303
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
304
304
pub enum GenericParamDefKind {
305
305
Lifetime ,
306
306
Type { bounds : Vec < GenericBound > , default : Option < Type > } ,
307
307
Const ( Type ) ,
308
308
}
309
309
310
310
#[ serde( rename_all = "snake_case" ) ]
311
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
311
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
312
312
pub enum WherePredicate {
313
313
BoundPredicate { ty : Type , bounds : Vec < GenericBound > } ,
314
314
RegionPredicate { lifetime : String , bounds : Vec < GenericBound > } ,
315
315
EqPredicate { lhs : Type , rhs : Type } ,
316
316
}
317
317
318
318
#[ serde( rename_all = "snake_case" ) ]
319
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
319
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
320
320
pub enum GenericBound {
321
321
TraitBound {
322
322
#[ serde( rename = "trait" ) ]
@@ -329,7 +329,7 @@ pub enum GenericBound {
329
329
}
330
330
331
331
#[ serde( rename_all = "snake_case" ) ]
332
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
332
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
333
333
pub enum TraitBoundModifier {
334
334
None ,
335
335
Maybe ,
@@ -338,7 +338,7 @@ pub enum TraitBoundModifier {
338
338
339
339
#[ serde( rename_all = "snake_case" ) ]
340
340
#[ serde( tag = "kind" , content = "inner" ) ]
341
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
341
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
342
342
pub enum Type {
343
343
/// Structs, enums, and traits
344
344
ResolvedPath {
@@ -391,22 +391,22 @@ pub enum Type {
391
391
} ,
392
392
}
393
393
394
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
394
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
395
395
pub struct FunctionPointer {
396
396
pub is_unsafe : bool ,
397
397
pub generic_params : Vec < GenericParamDef > ,
398
398
pub decl : FnDecl ,
399
399
pub abi : String ,
400
400
}
401
401
402
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
402
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
403
403
pub struct FnDecl {
404
404
pub inputs : Vec < ( String , Type ) > ,
405
405
pub output : Option < Type > ,
406
406
pub c_variadic : bool ,
407
407
}
408
408
409
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
409
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
410
410
pub struct Trait {
411
411
pub is_auto : bool ,
412
412
pub is_unsafe : bool ,
@@ -416,13 +416,13 @@ pub struct Trait {
416
416
pub implementors : Vec < Id > ,
417
417
}
418
418
419
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
419
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
420
420
pub struct TraitAlias {
421
421
pub generics : Generics ,
422
422
pub params : Vec < GenericBound > ,
423
423
}
424
424
425
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
425
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
426
426
pub struct Impl {
427
427
pub is_unsafe : bool ,
428
428
pub generics : Generics ,
@@ -438,7 +438,7 @@ pub struct Impl {
438
438
}
439
439
440
440
#[ serde( rename_all = "snake_case" ) ]
441
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
441
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
442
442
pub struct Import {
443
443
/// The full path being imported.
444
444
pub span : String ,
@@ -451,14 +451,14 @@ pub struct Import {
451
451
pub glob : bool ,
452
452
}
453
453
454
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
454
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
455
455
pub struct ProcMacro {
456
456
pub kind : MacroKind ,
457
457
pub helpers : Vec < String > ,
458
458
}
459
459
460
460
#[ serde( rename_all = "snake_case" ) ]
461
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
461
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
462
462
pub enum MacroKind {
463
463
/// A bang macro `foo!()`.
464
464
Bang ,
@@ -468,20 +468,20 @@ pub enum MacroKind {
468
468
Derive ,
469
469
}
470
470
471
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
471
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
472
472
pub struct Typedef {
473
473
#[ serde( rename = "type" ) ]
474
474
pub type_ : Type ,
475
475
pub generics : Generics ,
476
476
}
477
477
478
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
478
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
479
479
pub struct OpaqueTy {
480
480
pub bounds : Vec < GenericBound > ,
481
481
pub generics : Generics ,
482
482
}
483
483
484
- #[ derive( Clone , Debug , Serialize , Deserialize ) ]
484
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
485
485
pub struct Static {
486
486
#[ serde( rename = "type" ) ]
487
487
pub type_ : Type ,
0 commit comments