@@ -192,7 +192,6 @@ impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx>
192
192
visibility : Some ( Public ) ,
193
193
stability : get_stability ( cx, def_id) ,
194
194
deprecation : get_deprecation ( cx, def_id) ,
195
- non_exhaustive : false ,
196
195
def_id,
197
196
inner : PrimitiveItem ( prim) ,
198
197
}
@@ -205,7 +204,6 @@ impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx>
205
204
visibility : Some ( Public ) ,
206
205
stability : get_stability ( cx, def_id) ,
207
206
deprecation : get_deprecation ( cx, def_id) ,
208
- non_exhaustive : false ,
209
207
def_id,
210
208
inner : KeywordItem ( kw) ,
211
209
}
@@ -368,7 +366,6 @@ pub struct Item {
368
366
pub def_id : DefId ,
369
367
pub stability : Option < Stability > ,
370
368
pub deprecation : Option < Deprecation > ,
371
- pub non_exhaustive : bool ,
372
369
}
373
370
374
371
impl fmt:: Debug for Item {
@@ -498,6 +495,12 @@ impl Item {
498
495
self . stability . as_ref ( ) . map ( |s| & s. since [ ..] )
499
496
}
500
497
498
+ pub fn is_non_exhaustive ( & self ) -> bool {
499
+ self . attrs . other_attrs . iter ( )
500
+ . filter ( |a| a. name ( ) . as_str ( ) == "non_exhaustive" )
501
+ . count ( ) > 0
502
+ }
503
+
501
504
/// Returns a documentation-level item type from the item.
502
505
pub fn type_ ( & self ) -> ItemType {
503
506
ItemType :: from ( self )
@@ -628,7 +631,6 @@ impl Clean<Item> for doctree::Module {
628
631
visibility : self . vis . clean ( cx) ,
629
632
stability : self . stab . clean ( cx) ,
630
633
deprecation : self . depr . clean ( cx) ,
631
- non_exhaustive : false ,
632
634
def_id : cx. tcx . hir . local_def_id ( self . id ) ,
633
635
inner : ModuleItem ( Module {
634
636
is_crate : self . is_crate ,
@@ -2121,7 +2123,6 @@ impl Clean<Item> for doctree::Function {
2121
2123
visibility : self . vis . clean ( cx) ,
2122
2124
stability : self . stab . clean ( cx) ,
2123
2125
deprecation : self . depr . clean ( cx) ,
2124
- non_exhaustive : false ,
2125
2126
def_id : cx. tcx . hir . local_def_id ( self . id ) ,
2126
2127
inner : FunctionItem ( Function {
2127
2128
decl,
@@ -2303,7 +2304,6 @@ impl Clean<Item> for doctree::Trait {
2303
2304
visibility : self . vis . clean ( cx) ,
2304
2305
stability : self . stab . clean ( cx) ,
2305
2306
deprecation : self . depr . clean ( cx) ,
2306
- non_exhaustive : false ,
2307
2307
inner : TraitItem ( Trait {
2308
2308
auto : self . is_auto . clean ( cx) ,
2309
2309
unsafety : self . unsafety ,
@@ -2373,7 +2373,6 @@ impl Clean<Item> for hir::TraitItem {
2373
2373
visibility : None ,
2374
2374
stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
2375
2375
deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
2376
- non_exhaustive : false ,
2377
2376
inner,
2378
2377
}
2379
2378
}
@@ -2402,7 +2401,6 @@ impl Clean<Item> for hir::ImplItem {
2402
2401
visibility : self . vis . clean ( cx) ,
2403
2402
stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
2404
2403
deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
2405
- non_exhaustive : false ,
2406
2404
inner,
2407
2405
}
2408
2406
}
@@ -2549,7 +2547,6 @@ impl<'tcx> Clean<Item> for ty::AssociatedItem {
2549
2547
visibility,
2550
2548
stability : get_stability ( cx, self . def_id ) ,
2551
2549
deprecation : get_deprecation ( cx, self . def_id ) ,
2552
- non_exhaustive : false ,
2553
2550
def_id : self . def_id ,
2554
2551
attrs : inline:: load_attrs ( cx, self . def_id ) ,
2555
2552
source : cx. tcx . def_span ( self . def_id ) . clean ( cx) ,
@@ -3203,7 +3200,6 @@ impl Clean<Item> for hir::StructField {
3203
3200
visibility : self . vis . clean ( cx) ,
3204
3201
stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
3205
3202
deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
3206
- non_exhaustive : false ,
3207
3203
def_id : cx. tcx . hir . local_def_id ( self . id ) ,
3208
3204
inner : StructFieldItem ( self . ty . clean ( cx) ) ,
3209
3205
}
@@ -3219,7 +3215,6 @@ impl<'tcx> Clean<Item> for ty::FieldDef {
3219
3215
visibility : self . vis . clean ( cx) ,
3220
3216
stability : get_stability ( cx, self . did ) ,
3221
3217
deprecation : get_deprecation ( cx, self . did ) ,
3222
- non_exhaustive : false ,
3223
3218
def_id : self . did ,
3224
3219
inner : StructFieldItem ( cx. tcx . type_of ( self . did ) . clean ( cx) ) ,
3225
3220
}
@@ -3284,7 +3279,6 @@ impl Clean<Vec<Item>> for doctree::Struct {
3284
3279
visibility : self . vis . clean ( cx) ,
3285
3280
stability : self . stab . clean ( cx) ,
3286
3281
deprecation : self . depr . clean ( cx) ,
3287
- non_exhaustive : self . non_exhaustive ,
3288
3282
inner : StructItem ( Struct {
3289
3283
struct_type : self . struct_type ,
3290
3284
generics : self . generics . clean ( cx) ,
@@ -3310,7 +3304,6 @@ impl Clean<Vec<Item>> for doctree::Union {
3310
3304
visibility : self . vis . clean ( cx) ,
3311
3305
stability : self . stab . clean ( cx) ,
3312
3306
deprecation : self . depr . clean ( cx) ,
3313
- non_exhaustive : false ,
3314
3307
inner : UnionItem ( Union {
3315
3308
struct_type : self . struct_type ,
3316
3309
generics : self . generics . clean ( cx) ,
@@ -3363,7 +3356,6 @@ impl Clean<Vec<Item>> for doctree::Enum {
3363
3356
visibility : self . vis . clean ( cx) ,
3364
3357
stability : self . stab . clean ( cx) ,
3365
3358
deprecation : self . depr . clean ( cx) ,
3366
- non_exhaustive : self . non_exhaustive ,
3367
3359
inner : EnumItem ( Enum {
3368
3360
variants : self . variants . clean ( cx) ,
3369
3361
generics : self . generics . clean ( cx) ,
@@ -3389,7 +3381,6 @@ impl Clean<Item> for doctree::Variant {
3389
3381
visibility : None ,
3390
3382
stability : self . stab . clean ( cx) ,
3391
3383
deprecation : self . depr . clean ( cx) ,
3392
- non_exhaustive : false ,
3393
3384
def_id : cx. tcx . hir . local_def_id ( self . def . id ( ) ) ,
3394
3385
inner : VariantItem ( Variant {
3395
3386
kind : self . def . clean ( cx) ,
@@ -3420,7 +3411,6 @@ impl<'tcx> Clean<Item> for ty::VariantDef {
3420
3411
def_id : field. did ,
3421
3412
stability : get_stability ( cx, field. did ) ,
3422
3413
deprecation : get_deprecation ( cx, field. did ) ,
3423
- non_exhaustive : false ,
3424
3414
inner : StructFieldItem ( cx. tcx . type_of ( field. did ) . clean ( cx) )
3425
3415
}
3426
3416
} ) . collect ( )
@@ -3436,7 +3426,6 @@ impl<'tcx> Clean<Item> for ty::VariantDef {
3436
3426
inner : VariantItem ( Variant { kind : kind } ) ,
3437
3427
stability : get_stability ( cx, self . did ) ,
3438
3428
deprecation : get_deprecation ( cx, self . did ) ,
3439
- non_exhaustive : false ,
3440
3429
}
3441
3430
}
3442
3431
}
@@ -3688,7 +3677,6 @@ impl Clean<Item> for doctree::Typedef {
3688
3677
visibility : self . vis . clean ( cx) ,
3689
3678
stability : self . stab . clean ( cx) ,
3690
3679
deprecation : self . depr . clean ( cx) ,
3691
- non_exhaustive : false ,
3692
3680
inner : TypedefItem ( Typedef {
3693
3681
type_ : self . ty . clean ( cx) ,
3694
3682
generics : self . gen . clean ( cx) ,
@@ -3740,7 +3728,6 @@ impl Clean<Item> for doctree::Static {
3740
3728
visibility : self . vis . clean ( cx) ,
3741
3729
stability : self . stab . clean ( cx) ,
3742
3730
deprecation : self . depr . clean ( cx) ,
3743
- non_exhaustive : false ,
3744
3731
inner : StaticItem ( Static {
3745
3732
type_ : self . type_ . clean ( cx) ,
3746
3733
mutability : self . mutability . clean ( cx) ,
@@ -3766,7 +3753,6 @@ impl Clean<Item> for doctree::Constant {
3766
3753
visibility : self . vis . clean ( cx) ,
3767
3754
stability : self . stab . clean ( cx) ,
3768
3755
deprecation : self . depr . clean ( cx) ,
3769
- non_exhaustive : false ,
3770
3756
inner : ConstantItem ( Constant {
3771
3757
type_ : self . type_ . clean ( cx) ,
3772
3758
expr : print_const_expr ( cx, self . expr ) ,
@@ -3855,7 +3841,6 @@ impl Clean<Vec<Item>> for doctree::Impl {
3855
3841
visibility : self . vis . clean ( cx) ,
3856
3842
stability : self . stab . clean ( cx) ,
3857
3843
deprecation : self . depr . clean ( cx) ,
3858
- non_exhaustive : false ,
3859
3844
inner : ImplItem ( Impl {
3860
3845
unsafety : self . unsafety ,
3861
3846
generics : self . generics . clean ( cx) ,
@@ -3942,7 +3927,6 @@ impl Clean<Item> for doctree::ExternCrate {
3942
3927
visibility : self . vis . clean ( cx) ,
3943
3928
stability : None ,
3944
3929
deprecation : None ,
3945
- non_exhaustive : false ,
3946
3930
inner : ExternCrateItem ( self . name . clean ( cx) , self . path . clone ( ) )
3947
3931
}
3948
3932
}
@@ -3989,7 +3973,6 @@ impl Clean<Vec<Item>> for doctree::Import {
3989
3973
visibility: self . vis. clean( cx) ,
3990
3974
stability: None ,
3991
3975
deprecation: None ,
3992
- non_exhaustive: false ,
3993
3976
inner: ImportItem ( inner)
3994
3977
} ]
3995
3978
}
@@ -4058,7 +4041,6 @@ impl Clean<Item> for hir::ForeignItem {
4058
4041
visibility : self . vis . clean ( cx) ,
4059
4042
stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
4060
4043
deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
4061
- non_exhaustive : false ,
4062
4044
inner,
4063
4045
}
4064
4046
}
@@ -4233,7 +4215,6 @@ impl Clean<Item> for doctree::Macro {
4233
4215
visibility : Some ( Public ) ,
4234
4216
stability : self . stab . clean ( cx) ,
4235
4217
deprecation : self . depr . clean ( cx) ,
4236
- non_exhaustive : false ,
4237
4218
def_id : self . def_id ,
4238
4219
inner : MacroItem ( Macro {
4239
4220
source : format ! ( "macro_rules! {} {{\n {}}}" ,
0 commit comments