@@ -187,7 +187,7 @@ pub fn krate(mut cx: &mut DocContext<'_>) -> Crate {
187
187
source : Span :: empty ( ) ,
188
188
name : Some ( prim. to_url_str ( ) . to_string ( ) ) ,
189
189
attrs : attrs. clone ( ) ,
190
- visibility : Some ( Public ) ,
190
+ visibility : Public ,
191
191
stability : get_stability ( cx, def_id) ,
192
192
deprecation : get_deprecation ( cx, def_id) ,
193
193
def_id,
@@ -199,7 +199,7 @@ pub fn krate(mut cx: &mut DocContext<'_>) -> Crate {
199
199
source : Span :: empty ( ) ,
200
200
name : Some ( kw. clone ( ) ) ,
201
201
attrs : attrs,
202
- visibility : Some ( Public ) ,
202
+ visibility : Public ,
203
203
stability : get_stability ( cx, def_id) ,
204
204
deprecation : get_deprecation ( cx, def_id) ,
205
205
def_id,
@@ -361,7 +361,7 @@ pub struct Item {
361
361
pub name : Option < String > ,
362
362
pub attrs : Attributes ,
363
363
pub inner : ItemEnum ,
364
- pub visibility : Option < Visibility > ,
364
+ pub visibility : Visibility ,
365
365
pub def_id : DefId ,
366
366
pub stability : Option < Stability > ,
367
367
pub deprecation : Option < Deprecation > ,
@@ -1849,7 +1849,7 @@ fn get_real_types(
1849
1849
cx : & DocContext < ' _ > ,
1850
1850
recurse : i32 ,
1851
1851
) -> FxHashSet < Type > {
1852
- let arg_s = arg. to_string ( ) ;
1852
+ let arg_s = arg. print ( ) . to_string ( ) ;
1853
1853
let mut res = FxHashSet :: default ( ) ;
1854
1854
if recurse >= 10 { // FIXME: remove this whole recurse thing when the recursion bug is fixed
1855
1855
return res;
@@ -2311,7 +2311,7 @@ impl Clean<Item> for hir::TraitItem {
2311
2311
attrs : self . attrs . clean ( cx) ,
2312
2312
source : self . span . clean ( cx) ,
2313
2313
def_id : local_did,
2314
- visibility : None ,
2314
+ visibility : Visibility :: Inherited ,
2315
2315
stability : get_stability ( cx, local_did) ,
2316
2316
deprecation : get_deprecation ( cx, local_did) ,
2317
2317
inner,
@@ -2496,7 +2496,7 @@ impl Clean<Item> for ty::AssocItem {
2496
2496
2497
2497
let visibility = match self . container {
2498
2498
ty:: ImplContainer ( _) => self . vis . clean ( cx) ,
2499
- ty:: TraitContainer ( _) => None ,
2499
+ ty:: TraitContainer ( _) => Inherited ,
2500
2500
} ;
2501
2501
2502
2502
Item {
@@ -3293,9 +3293,9 @@ pub enum Visibility {
3293
3293
Restricted ( DefId , Path ) ,
3294
3294
}
3295
3295
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 {
3299
3299
hir:: VisibilityKind :: Public => Visibility :: Public ,
3300
3300
hir:: VisibilityKind :: Inherited => Visibility :: Inherited ,
3301
3301
hir:: VisibilityKind :: Crate ( _) => Visibility :: Crate ,
@@ -3304,13 +3304,13 @@ impl Clean<Option<Visibility>> for hir::Visibility {
3304
3304
let did = register_res ( cx, path. res ) ;
3305
3305
Visibility :: Restricted ( did, path)
3306
3306
}
3307
- } )
3307
+ }
3308
3308
}
3309
3309
}
3310
3310
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 }
3314
3314
}
3315
3315
}
3316
3316
@@ -3427,7 +3427,7 @@ impl Clean<Item> for doctree::Variant<'_> {
3427
3427
name : Some ( self . name . clean ( cx) ) ,
3428
3428
attrs : self . attrs . clean ( cx) ,
3429
3429
source : self . whence . clean ( cx) ,
3430
- visibility : None ,
3430
+ visibility : Inherited ,
3431
3431
stability : cx. stability ( self . id ) . clean ( cx) ,
3432
3432
deprecation : cx. deprecation ( self . id ) . clean ( cx) ,
3433
3433
def_id : cx. tcx . hir ( ) . local_def_id ( self . id ) ,
@@ -3470,7 +3470,7 @@ impl Clean<Item> for ty::VariantDef {
3470
3470
name : Some ( self . ident . clean ( cx) ) ,
3471
3471
attrs : inline:: load_attrs ( cx, self . def_id ) . clean ( cx) ,
3472
3472
source : cx. tcx . def_span ( self . def_id ) . clean ( cx) ,
3473
- visibility : Some ( Inherited ) ,
3473
+ visibility : Inherited ,
3474
3474
def_id : self . def_id ,
3475
3475
inner : VariantItem ( Variant { kind } ) ,
3476
3476
stability : get_stability ( cx, self . def_id ) ,
@@ -3573,16 +3573,6 @@ pub enum GenericArg {
3573
3573
Const ( Constant ) ,
3574
3574
}
3575
3575
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
-
3586
3576
#[ derive( Clone , PartialEq , Eq , Debug , Hash ) ]
3587
3577
pub enum GenericArgs {
3588
3578
AngleBracketed {
@@ -4274,7 +4264,7 @@ fn resolve_type(cx: &DocContext<'_>,
4274
4264
return Generic ( kw:: SelfUpper . to_string ( ) ) ;
4275
4265
}
4276
4266
Res :: Def ( DefKind :: TyParam , _) if path. segments . len ( ) == 1 => {
4277
- return Generic ( format ! ( "{:#}" , path) ) ;
4267
+ return Generic ( format ! ( "{:#}" , path. print ( ) ) ) ;
4278
4268
}
4279
4269
Res :: SelfTy ( ..)
4280
4270
| Res :: Def ( DefKind :: TyParam , _)
@@ -4343,7 +4333,7 @@ impl Clean<Item> for doctree::Macro<'_> {
4343
4333
name : Some ( name. clone ( ) ) ,
4344
4334
attrs : self . attrs . clean ( cx) ,
4345
4335
source : self . whence . clean ( cx) ,
4346
- visibility : Some ( Public ) ,
4336
+ visibility : Public ,
4347
4337
stability : cx. stability ( self . hid ) . clean ( cx) ,
4348
4338
deprecation : cx. deprecation ( self . hid ) . clean ( cx) ,
4349
4339
def_id : self . def_id ,
@@ -4371,7 +4361,7 @@ impl Clean<Item> for doctree::ProcMacro<'_> {
4371
4361
name : Some ( self . name . clean ( cx) ) ,
4372
4362
attrs : self . attrs . clean ( cx) ,
4373
4363
source : self . whence . clean ( cx) ,
4374
- visibility : Some ( Public ) ,
4364
+ visibility : Public ,
4375
4365
stability : cx. stability ( self . id ) . clean ( cx) ,
4376
4366
deprecation : cx. deprecation ( self . id ) . clean ( cx) ,
4377
4367
def_id : cx. tcx . hir ( ) . local_def_id ( self . id ) ,
0 commit comments