@@ -192,7 +192,6 @@ impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx>
192192 visibility : Some ( Public ) ,
193193 stability : get_stability ( cx, def_id) ,
194194 deprecation : get_deprecation ( cx, def_id) ,
195- non_exhaustive : false ,
196195 def_id,
197196 inner : PrimitiveItem ( prim) ,
198197 }
@@ -205,7 +204,6 @@ impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx>
205204 visibility : Some ( Public ) ,
206205 stability : get_stability ( cx, def_id) ,
207206 deprecation : get_deprecation ( cx, def_id) ,
208- non_exhaustive : false ,
209207 def_id,
210208 inner : KeywordItem ( kw) ,
211209 }
@@ -368,7 +366,6 @@ pub struct Item {
368366 pub def_id : DefId ,
369367 pub stability : Option < Stability > ,
370368 pub deprecation : Option < Deprecation > ,
371- pub non_exhaustive : bool ,
372369}
373370
374371impl fmt:: Debug for Item {
@@ -498,6 +495,12 @@ impl Item {
498495 self . stability . as_ref ( ) . map ( |s| & s. since [ ..] )
499496 }
500497
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+
501504 /// Returns a documentation-level item type from the item.
502505 pub fn type_ ( & self ) -> ItemType {
503506 ItemType :: from ( self )
@@ -628,7 +631,6 @@ impl Clean<Item> for doctree::Module {
628631 visibility : self . vis . clean ( cx) ,
629632 stability : self . stab . clean ( cx) ,
630633 deprecation : self . depr . clean ( cx) ,
631- non_exhaustive : false ,
632634 def_id : cx. tcx . hir . local_def_id ( self . id ) ,
633635 inner : ModuleItem ( Module {
634636 is_crate : self . is_crate ,
@@ -2121,7 +2123,6 @@ impl Clean<Item> for doctree::Function {
21212123 visibility : self . vis . clean ( cx) ,
21222124 stability : self . stab . clean ( cx) ,
21232125 deprecation : self . depr . clean ( cx) ,
2124- non_exhaustive : false ,
21252126 def_id : cx. tcx . hir . local_def_id ( self . id ) ,
21262127 inner : FunctionItem ( Function {
21272128 decl,
@@ -2303,7 +2304,6 @@ impl Clean<Item> for doctree::Trait {
23032304 visibility : self . vis . clean ( cx) ,
23042305 stability : self . stab . clean ( cx) ,
23052306 deprecation : self . depr . clean ( cx) ,
2306- non_exhaustive : false ,
23072307 inner : TraitItem ( Trait {
23082308 auto : self . is_auto . clean ( cx) ,
23092309 unsafety : self . unsafety ,
@@ -2373,7 +2373,6 @@ impl Clean<Item> for hir::TraitItem {
23732373 visibility : None ,
23742374 stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
23752375 deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
2376- non_exhaustive : false ,
23772376 inner,
23782377 }
23792378 }
@@ -2402,7 +2401,6 @@ impl Clean<Item> for hir::ImplItem {
24022401 visibility : self . vis . clean ( cx) ,
24032402 stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
24042403 deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
2405- non_exhaustive : false ,
24062404 inner,
24072405 }
24082406 }
@@ -2549,7 +2547,6 @@ impl<'tcx> Clean<Item> for ty::AssociatedItem {
25492547 visibility,
25502548 stability : get_stability ( cx, self . def_id ) ,
25512549 deprecation : get_deprecation ( cx, self . def_id ) ,
2552- non_exhaustive : false ,
25532550 def_id : self . def_id ,
25542551 attrs : inline:: load_attrs ( cx, self . def_id ) ,
25552552 source : cx. tcx . def_span ( self . def_id ) . clean ( cx) ,
@@ -3203,7 +3200,6 @@ impl Clean<Item> for hir::StructField {
32033200 visibility : self . vis . clean ( cx) ,
32043201 stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
32053202 deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
3206- non_exhaustive : false ,
32073203 def_id : cx. tcx . hir . local_def_id ( self . id ) ,
32083204 inner : StructFieldItem ( self . ty . clean ( cx) ) ,
32093205 }
@@ -3219,7 +3215,6 @@ impl<'tcx> Clean<Item> for ty::FieldDef {
32193215 visibility : self . vis . clean ( cx) ,
32203216 stability : get_stability ( cx, self . did ) ,
32213217 deprecation : get_deprecation ( cx, self . did ) ,
3222- non_exhaustive : false ,
32233218 def_id : self . did ,
32243219 inner : StructFieldItem ( cx. tcx . type_of ( self . did ) . clean ( cx) ) ,
32253220 }
@@ -3284,7 +3279,6 @@ impl Clean<Vec<Item>> for doctree::Struct {
32843279 visibility : self . vis . clean ( cx) ,
32853280 stability : self . stab . clean ( cx) ,
32863281 deprecation : self . depr . clean ( cx) ,
3287- non_exhaustive : self . non_exhaustive ,
32883282 inner : StructItem ( Struct {
32893283 struct_type : self . struct_type ,
32903284 generics : self . generics . clean ( cx) ,
@@ -3310,7 +3304,6 @@ impl Clean<Vec<Item>> for doctree::Union {
33103304 visibility : self . vis . clean ( cx) ,
33113305 stability : self . stab . clean ( cx) ,
33123306 deprecation : self . depr . clean ( cx) ,
3313- non_exhaustive : false ,
33143307 inner : UnionItem ( Union {
33153308 struct_type : self . struct_type ,
33163309 generics : self . generics . clean ( cx) ,
@@ -3363,7 +3356,6 @@ impl Clean<Vec<Item>> for doctree::Enum {
33633356 visibility : self . vis . clean ( cx) ,
33643357 stability : self . stab . clean ( cx) ,
33653358 deprecation : self . depr . clean ( cx) ,
3366- non_exhaustive : self . non_exhaustive ,
33673359 inner : EnumItem ( Enum {
33683360 variants : self . variants . clean ( cx) ,
33693361 generics : self . generics . clean ( cx) ,
@@ -3389,7 +3381,6 @@ impl Clean<Item> for doctree::Variant {
33893381 visibility : None ,
33903382 stability : self . stab . clean ( cx) ,
33913383 deprecation : self . depr . clean ( cx) ,
3392- non_exhaustive : false ,
33933384 def_id : cx. tcx . hir . local_def_id ( self . def . id ( ) ) ,
33943385 inner : VariantItem ( Variant {
33953386 kind : self . def . clean ( cx) ,
@@ -3420,7 +3411,6 @@ impl<'tcx> Clean<Item> for ty::VariantDef {
34203411 def_id : field. did ,
34213412 stability : get_stability ( cx, field. did ) ,
34223413 deprecation : get_deprecation ( cx, field. did ) ,
3423- non_exhaustive : false ,
34243414 inner : StructFieldItem ( cx. tcx . type_of ( field. did ) . clean ( cx) )
34253415 }
34263416 } ) . collect ( )
@@ -3436,7 +3426,6 @@ impl<'tcx> Clean<Item> for ty::VariantDef {
34363426 inner : VariantItem ( Variant { kind : kind } ) ,
34373427 stability : get_stability ( cx, self . did ) ,
34383428 deprecation : get_deprecation ( cx, self . did ) ,
3439- non_exhaustive : false ,
34403429 }
34413430 }
34423431}
@@ -3688,7 +3677,6 @@ impl Clean<Item> for doctree::Typedef {
36883677 visibility : self . vis . clean ( cx) ,
36893678 stability : self . stab . clean ( cx) ,
36903679 deprecation : self . depr . clean ( cx) ,
3691- non_exhaustive : false ,
36923680 inner : TypedefItem ( Typedef {
36933681 type_ : self . ty . clean ( cx) ,
36943682 generics : self . gen . clean ( cx) ,
@@ -3740,7 +3728,6 @@ impl Clean<Item> for doctree::Static {
37403728 visibility : self . vis . clean ( cx) ,
37413729 stability : self . stab . clean ( cx) ,
37423730 deprecation : self . depr . clean ( cx) ,
3743- non_exhaustive : false ,
37443731 inner : StaticItem ( Static {
37453732 type_ : self . type_ . clean ( cx) ,
37463733 mutability : self . mutability . clean ( cx) ,
@@ -3766,7 +3753,6 @@ impl Clean<Item> for doctree::Constant {
37663753 visibility : self . vis . clean ( cx) ,
37673754 stability : self . stab . clean ( cx) ,
37683755 deprecation : self . depr . clean ( cx) ,
3769- non_exhaustive : false ,
37703756 inner : ConstantItem ( Constant {
37713757 type_ : self . type_ . clean ( cx) ,
37723758 expr : print_const_expr ( cx, self . expr ) ,
@@ -3855,7 +3841,6 @@ impl Clean<Vec<Item>> for doctree::Impl {
38553841 visibility : self . vis . clean ( cx) ,
38563842 stability : self . stab . clean ( cx) ,
38573843 deprecation : self . depr . clean ( cx) ,
3858- non_exhaustive : false ,
38593844 inner : ImplItem ( Impl {
38603845 unsafety : self . unsafety ,
38613846 generics : self . generics . clean ( cx) ,
@@ -3942,7 +3927,6 @@ impl Clean<Item> for doctree::ExternCrate {
39423927 visibility : self . vis . clean ( cx) ,
39433928 stability : None ,
39443929 deprecation : None ,
3945- non_exhaustive : false ,
39463930 inner : ExternCrateItem ( self . name . clean ( cx) , self . path . clone ( ) )
39473931 }
39483932 }
@@ -3989,7 +3973,6 @@ impl Clean<Vec<Item>> for doctree::Import {
39893973 visibility: self . vis. clean( cx) ,
39903974 stability: None ,
39913975 deprecation: None ,
3992- non_exhaustive: false ,
39933976 inner: ImportItem ( inner)
39943977 } ]
39953978 }
@@ -4058,7 +4041,6 @@ impl Clean<Item> for hir::ForeignItem {
40584041 visibility : self . vis . clean ( cx) ,
40594042 stability : get_stability ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
40604043 deprecation : get_deprecation ( cx, cx. tcx . hir . local_def_id ( self . id ) ) ,
4061- non_exhaustive : false ,
40624044 inner,
40634045 }
40644046 }
@@ -4233,7 +4215,6 @@ impl Clean<Item> for doctree::Macro {
42334215 visibility : Some ( Public ) ,
42344216 stability : self . stab . clean ( cx) ,
42354217 deprecation : self . depr . clean ( cx) ,
4236- non_exhaustive : false ,
42374218 def_id : self . def_id ,
42384219 inner : MacroItem ( Macro {
42394220 source : format ! ( "macro_rules! {} {{\n {}}}" ,
0 commit comments