@@ -403,7 +403,7 @@ fn clean_projection<'tcx>(
403
403
Type :: QPath {
404
404
assoc : Box :: new ( projection_to_path_segment ( ty, cx) ) ,
405
405
should_show_cast,
406
- self_type : box self_type,
406
+ self_type : Box :: new ( self_type) ,
407
407
trait_,
408
408
}
409
409
}
@@ -1320,7 +1320,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1320
1320
Type :: QPath {
1321
1321
assoc : Box :: new ( p. segments . last ( ) . expect ( "segments were empty" ) . clean ( cx) ) ,
1322
1322
should_show_cast,
1323
- self_type : box self_type,
1323
+ self_type : Box :: new ( self_type) ,
1324
1324
trait_,
1325
1325
}
1326
1326
}
@@ -1340,7 +1340,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1340
1340
Type :: QPath {
1341
1341
assoc : Box :: new ( segment. clean ( cx) ) ,
1342
1342
should_show_cast,
1343
- self_type : box self_type,
1343
+ self_type : Box :: new ( self_type) ,
1344
1344
trait_,
1345
1345
}
1346
1346
}
@@ -1440,7 +1440,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
1440
1440
1441
1441
match self . kind {
1442
1442
TyKind :: Never => Primitive ( PrimitiveType :: Never ) ,
1443
- TyKind :: Ptr ( ref m) => RawPointer ( m. mutbl , box m. ty . clean ( cx) ) ,
1443
+ TyKind :: Ptr ( ref m) => RawPointer ( m. mutbl , Box :: new ( m. ty . clean ( cx) ) ) ,
1444
1444
TyKind :: Rptr ( ref l, ref m) => {
1445
1445
// There are two times a `Fresh` lifetime can be created:
1446
1446
// 1. For `&'_ x`, written by the user. This corresponds to `lower_lifetime` in `rustc_ast_lowering`.
@@ -1452,9 +1452,9 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
1452
1452
let elided =
1453
1453
l. is_elided ( ) || matches ! ( l. name, LifetimeName :: Param ( _, ParamName :: Fresh ) ) ;
1454
1454
let lifetime = if elided { None } else { Some ( l. clean ( cx) ) } ;
1455
- BorrowedRef { lifetime, mutability : m. mutbl , type_ : box m. ty . clean ( cx) }
1455
+ BorrowedRef { lifetime, mutability : m. mutbl , type_ : Box :: new ( m. ty . clean ( cx) ) }
1456
1456
}
1457
- TyKind :: Slice ( ty) => Slice ( box ty. clean ( cx) ) ,
1457
+ TyKind :: Slice ( ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
1458
1458
TyKind :: Array ( ty, ref length) => {
1459
1459
let length = match length {
1460
1460
hir:: ArrayLen :: Infer ( _, _) => "_" . to_string ( ) ,
@@ -1473,7 +1473,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
1473
1473
}
1474
1474
} ;
1475
1475
1476
- Array ( box ty. clean ( cx) , length)
1476
+ Array ( Box :: new ( ty. clean ( cx) ) , length)
1477
1477
}
1478
1478
TyKind :: Tup ( tys) => Tuple ( tys. iter ( ) . map ( |x| x. clean ( cx) ) . collect ( ) ) ,
1479
1479
TyKind :: OpaqueDef ( item_id, _) => {
@@ -1540,16 +1540,16 @@ fn clean_ty<'tcx>(this: Ty<'tcx>, cx: &mut DocContext<'tcx>, def_id: Option<DefI
1540
1540
ty:: Uint ( uint_ty) => Primitive ( uint_ty. into ( ) ) ,
1541
1541
ty:: Float ( float_ty) => Primitive ( float_ty. into ( ) ) ,
1542
1542
ty:: Str => Primitive ( PrimitiveType :: Str ) ,
1543
- ty:: Slice ( ty) => Slice ( box ty. clean ( cx) ) ,
1543
+ ty:: Slice ( ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
1544
1544
ty:: Array ( ty, n) => {
1545
1545
let mut n = cx. tcx . lift ( n) . expect ( "array lift failed" ) ;
1546
1546
n = n. eval ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) ;
1547
1547
let n = print_const ( cx, n) ;
1548
- Array ( box ty. clean ( cx) , n)
1548
+ Array ( Box :: new ( ty. clean ( cx) ) , n)
1549
1549
}
1550
- ty:: RawPtr ( mt) => RawPointer ( mt. mutbl , box mt. ty . clean ( cx) ) ,
1550
+ ty:: RawPtr ( mt) => RawPointer ( mt. mutbl , Box :: new ( mt. ty . clean ( cx) ) ) ,
1551
1551
ty:: Ref ( r, ty, mutbl) => {
1552
- BorrowedRef { lifetime : r. clean ( cx) , mutability : mutbl, type_ : box ty. clean ( cx) }
1552
+ BorrowedRef { lifetime : r. clean ( cx) , mutability : mutbl, type_ : Box :: new ( ty. clean ( cx) ) }
1553
1553
}
1554
1554
ty:: FnDef ( ..) | ty:: FnPtr ( _) => {
1555
1555
let ty = cx. tcx . lift ( this) . expect ( "FnPtr lift failed" ) ;
0 commit comments