@@ -187,7 +187,7 @@ pub fn krate(mut cx: &mut DocContext<'_>) -> Crate {
187187 source : Span :: empty ( ) ,
188188 name : Some ( prim. to_url_str ( ) . to_string ( ) ) ,
189189 attrs : attrs. clone ( ) ,
190- visibility : Some ( Public ) ,
190+ visibility : Public ,
191191 stability : get_stability ( cx, def_id) ,
192192 deprecation : get_deprecation ( cx, def_id) ,
193193 def_id,
@@ -199,7 +199,7 @@ pub fn krate(mut cx: &mut DocContext<'_>) -> Crate {
199199 source : Span :: empty ( ) ,
200200 name : Some ( kw. clone ( ) ) ,
201201 attrs : attrs,
202- visibility : Some ( Public ) ,
202+ visibility : Public ,
203203 stability : get_stability ( cx, def_id) ,
204204 deprecation : get_deprecation ( cx, def_id) ,
205205 def_id,
@@ -361,7 +361,7 @@ pub struct Item {
361361 pub name : Option < String > ,
362362 pub attrs : Attributes ,
363363 pub inner : ItemEnum ,
364- pub visibility : Option < Visibility > ,
364+ pub visibility : Visibility ,
365365 pub def_id : DefId ,
366366 pub stability : Option < Stability > ,
367367 pub deprecation : Option < Deprecation > ,
@@ -1849,7 +1849,7 @@ fn get_real_types(
18491849 cx : & DocContext < ' _ > ,
18501850 recurse : i32 ,
18511851) -> FxHashSet < Type > {
1852- let arg_s = arg. to_string ( ) ;
1852+ let arg_s = arg. print ( ) . to_string ( ) ;
18531853 let mut res = FxHashSet :: default ( ) ;
18541854 if recurse >= 10 { // FIXME: remove this whole recurse thing when the recursion bug is fixed
18551855 return res;
@@ -2311,7 +2311,7 @@ impl Clean<Item> for hir::TraitItem {
23112311 attrs : self . attrs . clean ( cx) ,
23122312 source : self . span . clean ( cx) ,
23132313 def_id : local_did,
2314- visibility : None ,
2314+ visibility : Visibility :: Inherited ,
23152315 stability : get_stability ( cx, local_did) ,
23162316 deprecation : get_deprecation ( cx, local_did) ,
23172317 inner,
@@ -2496,7 +2496,7 @@ impl Clean<Item> for ty::AssocItem {
24962496
24972497 let visibility = match self . container {
24982498 ty:: ImplContainer ( _) => self . vis . clean ( cx) ,
2499- ty:: TraitContainer ( _) => None ,
2499+ ty:: TraitContainer ( _) => Inherited ,
25002500 } ;
25012501
25022502 Item {
@@ -3293,9 +3293,9 @@ pub enum Visibility {
32933293 Restricted ( DefId , Path ) ,
32943294}
32953295
3296- impl Clean < Option < Visibility > > for hir:: Visibility {
3297- fn clean ( & self , cx : & DocContext < ' _ > ) -> Option < Visibility > {
3298- Some ( match self . node {
3296+ impl Clean < Visibility > for hir:: Visibility {
3297+ fn clean ( & self , cx : & DocContext < ' _ > ) -> Visibility {
3298+ match self . node {
32993299 hir:: VisibilityKind :: Public => Visibility :: Public ,
33003300 hir:: VisibilityKind :: Inherited => Visibility :: Inherited ,
33013301 hir:: VisibilityKind :: Crate ( _) => Visibility :: Crate ,
@@ -3304,13 +3304,13 @@ impl Clean<Option<Visibility>> for hir::Visibility {
33043304 let did = register_res ( cx, path. res ) ;
33053305 Visibility :: Restricted ( did, path)
33063306 }
3307- } )
3307+ }
33083308 }
33093309}
33103310
3311- impl Clean < Option < Visibility > > for ty:: Visibility {
3312- fn clean ( & self , _: & DocContext < ' _ > ) -> Option < Visibility > {
3313- Some ( if * self == ty:: Visibility :: Public { Public } else { Inherited } )
3311+ impl Clean < Visibility > for ty:: Visibility {
3312+ fn clean ( & self , _: & DocContext < ' _ > ) -> Visibility {
3313+ if * self == ty:: Visibility :: Public { Public } else { Inherited }
33143314 }
33153315}
33163316
@@ -3427,7 +3427,7 @@ impl Clean<Item> for doctree::Variant<'_> {
34273427 name : Some ( self . name . clean ( cx) ) ,
34283428 attrs : self . attrs . clean ( cx) ,
34293429 source : self . whence . clean ( cx) ,
3430- visibility : None ,
3430+ visibility : Inherited ,
34313431 stability : cx. stability ( self . id ) . clean ( cx) ,
34323432 deprecation : cx. deprecation ( self . id ) . clean ( cx) ,
34333433 def_id : cx. tcx . hir ( ) . local_def_id ( self . id ) ,
@@ -3470,7 +3470,7 @@ impl Clean<Item> for ty::VariantDef {
34703470 name : Some ( self . ident . clean ( cx) ) ,
34713471 attrs : inline:: load_attrs ( cx, self . def_id ) . clean ( cx) ,
34723472 source : cx. tcx . def_span ( self . def_id ) . clean ( cx) ,
3473- visibility : Some ( Inherited ) ,
3473+ visibility : Inherited ,
34743474 def_id : self . def_id ,
34753475 inner : VariantItem ( Variant { kind } ) ,
34763476 stability : get_stability ( cx, self . def_id ) ,
@@ -3573,16 +3573,6 @@ pub enum GenericArg {
35733573 Const ( Constant ) ,
35743574}
35753575
3576- impl fmt:: Display for GenericArg {
3577- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
3578- match self {
3579- GenericArg :: Lifetime ( lt) => lt. fmt ( f) ,
3580- GenericArg :: Type ( ty) => ty. fmt ( f) ,
3581- GenericArg :: Const ( ct) => ct. fmt ( f) ,
3582- }
3583- }
3584- }
3585-
35863576#[ derive( Clone , PartialEq , Eq , Debug , Hash ) ]
35873577pub enum GenericArgs {
35883578 AngleBracketed {
@@ -4274,7 +4264,7 @@ fn resolve_type(cx: &DocContext<'_>,
42744264 return Generic ( kw:: SelfUpper . to_string ( ) ) ;
42754265 }
42764266 Res :: Def ( DefKind :: TyParam , _) if path. segments . len ( ) == 1 => {
4277- return Generic ( format ! ( "{:#}" , path) ) ;
4267+ return Generic ( format ! ( "{:#}" , path. print ( ) ) ) ;
42784268 }
42794269 Res :: SelfTy ( ..)
42804270 | Res :: Def ( DefKind :: TyParam , _)
@@ -4343,7 +4333,7 @@ impl Clean<Item> for doctree::Macro<'_> {
43434333 name : Some ( name. clone ( ) ) ,
43444334 attrs : self . attrs . clean ( cx) ,
43454335 source : self . whence . clean ( cx) ,
4346- visibility : Some ( Public ) ,
4336+ visibility : Public ,
43474337 stability : cx. stability ( self . hid ) . clean ( cx) ,
43484338 deprecation : cx. deprecation ( self . hid ) . clean ( cx) ,
43494339 def_id : self . def_id ,
@@ -4371,7 +4361,7 @@ impl Clean<Item> for doctree::ProcMacro<'_> {
43714361 name : Some ( self . name . clean ( cx) ) ,
43724362 attrs : self . attrs . clean ( cx) ,
43734363 source : self . whence . clean ( cx) ,
4374- visibility : Some ( Public ) ,
4364+ visibility : Public ,
43754365 stability : cx. stability ( self . id ) . clean ( cx) ,
43764366 deprecation : cx. deprecation ( self . id ) . clean ( cx) ,
43774367 def_id : cx. tcx . hir ( ) . local_def_id ( self . id ) ,
0 commit comments