@@ -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
}
@@ -1321,7 +1321,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1321
1321
Type :: QPath {
1322
1322
assoc : Box :: new ( p. segments . last ( ) . expect ( "segments were empty" ) . clean ( cx) ) ,
1323
1323
should_show_cast,
1324
- self_type : box self_type,
1324
+ self_type : Box :: new ( self_type) ,
1325
1325
trait_,
1326
1326
}
1327
1327
}
@@ -1341,7 +1341,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1341
1341
Type :: QPath {
1342
1342
assoc : Box :: new ( segment. clean ( cx) ) ,
1343
1343
should_show_cast,
1344
- self_type : box self_type,
1344
+ self_type : Box :: new ( self_type) ,
1345
1345
trait_,
1346
1346
}
1347
1347
}
@@ -1441,7 +1441,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
1441
1441
1442
1442
match self . kind {
1443
1443
TyKind :: Never => Primitive ( PrimitiveType :: Never ) ,
1444
- TyKind :: Ptr ( ref m) => RawPointer ( m. mutbl , box m. ty . clean ( cx) ) ,
1444
+ TyKind :: Ptr ( ref m) => RawPointer ( m. mutbl , Box :: new ( m. ty . clean ( cx) ) ) ,
1445
1445
TyKind :: Rptr ( ref l, ref m) => {
1446
1446
// There are two times a `Fresh` lifetime can be created:
1447
1447
// 1. For `&'_ x`, written by the user. This corresponds to `lower_lifetime` in `rustc_ast_lowering`.
@@ -1453,9 +1453,9 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
1453
1453
let elided =
1454
1454
l. is_elided ( ) || matches ! ( l. name, LifetimeName :: Param ( _, ParamName :: Fresh ) ) ;
1455
1455
let lifetime = if elided { None } else { Some ( l. clean ( cx) ) } ;
1456
- BorrowedRef { lifetime, mutability : m. mutbl , type_ : box m. ty . clean ( cx) }
1456
+ BorrowedRef { lifetime, mutability : m. mutbl , type_ : Box :: new ( m. ty . clean ( cx) ) }
1457
1457
}
1458
- TyKind :: Slice ( ty) => Slice ( box ty. clean ( cx) ) ,
1458
+ TyKind :: Slice ( ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
1459
1459
TyKind :: Array ( ty, ref length) => {
1460
1460
let length = match length {
1461
1461
hir:: ArrayLen :: Infer ( _, _) => "_" . to_string ( ) ,
@@ -1474,7 +1474,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
1474
1474
}
1475
1475
} ;
1476
1476
1477
- Array ( box ty. clean ( cx) , length)
1477
+ Array ( Box :: new ( ty. clean ( cx) ) , length)
1478
1478
}
1479
1479
TyKind :: Tup ( tys) => Tuple ( tys. iter ( ) . map ( |x| x. clean ( cx) ) . collect ( ) ) ,
1480
1480
TyKind :: OpaqueDef ( item_id, _) => {
@@ -1491,7 +1491,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
1491
1491
let lifetime = if !lifetime. is_elided ( ) { Some ( lifetime. clean ( cx) ) } else { None } ;
1492
1492
DynTrait ( bounds, lifetime)
1493
1493
}
1494
- TyKind :: BareFn ( barefn) => BareFunction ( box barefn. clean ( cx) ) ,
1494
+ TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( barefn. clean ( cx) ) ) ,
1495
1495
// Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
1496
1496
TyKind :: Infer | TyKind :: Err => Infer ,
1497
1497
TyKind :: Typeof ( ..) => panic ! ( "unimplemented type {:?}" , self . kind) ,
@@ -1541,27 +1541,27 @@ fn clean_ty<'tcx>(this: Ty<'tcx>, cx: &mut DocContext<'tcx>, def_id: Option<DefI
1541
1541
ty:: Uint ( uint_ty) => Primitive ( uint_ty. into ( ) ) ,
1542
1542
ty:: Float ( float_ty) => Primitive ( float_ty. into ( ) ) ,
1543
1543
ty:: Str => Primitive ( PrimitiveType :: Str ) ,
1544
- ty:: Slice ( ty) => Slice ( box ty. clean ( cx) ) ,
1544
+ ty:: Slice ( ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
1545
1545
ty:: Array ( ty, n) => {
1546
1546
let mut n = cx. tcx . lift ( n) . expect ( "array lift failed" ) ;
1547
1547
n = n. eval ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) ;
1548
1548
let n = print_const ( cx, n) ;
1549
- Array ( box ty. clean ( cx) , n)
1549
+ Array ( Box :: new ( ty. clean ( cx) ) , n)
1550
1550
}
1551
- ty:: RawPtr ( mt) => RawPointer ( mt. mutbl , box mt. ty . clean ( cx) ) ,
1551
+ ty:: RawPtr ( mt) => RawPointer ( mt. mutbl , Box :: new ( mt. ty . clean ( cx) ) ) ,
1552
1552
ty:: Ref ( r, ty, mutbl) => {
1553
- BorrowedRef { lifetime : r. clean ( cx) , mutability : mutbl, type_ : box ty. clean ( cx) }
1553
+ BorrowedRef { lifetime : r. clean ( cx) , mutability : mutbl, type_ : Box :: new ( ty. clean ( cx) ) }
1554
1554
}
1555
1555
ty:: FnDef ( ..) | ty:: FnPtr ( _) => {
1556
1556
let ty = cx. tcx . lift ( this) . expect ( "FnPtr lift failed" ) ;
1557
1557
let sig = ty. fn_sig ( cx. tcx ) ;
1558
1558
let decl = clean_fn_decl_from_did_and_sig ( cx, None , sig) ;
1559
- BareFunction ( box BareFunctionDecl {
1559
+ BareFunction ( Box :: new ( BareFunctionDecl {
1560
1560
unsafety : sig. unsafety ( ) ,
1561
1561
generic_params : Vec :: new ( ) ,
1562
1562
decl,
1563
1563
abi : sig. abi ( ) ,
1564
- } )
1564
+ } ) )
1565
1565
}
1566
1566
ty:: Adt ( def, substs) => {
1567
1567
let did = def. did ( ) ;
@@ -2062,7 +2062,7 @@ fn clean_extern_crate<'tcx>(
2062
2062
// FIXME: using `from_def_id_and_kind` breaks `rustdoc/masked` for some reason
2063
2063
vec ! [ Item {
2064
2064
name: Some ( name) ,
2065
- attrs: box attrs. clean( cx) ,
2065
+ attrs: Box :: new ( attrs. clean( cx) ) ,
2066
2066
item_id: crate_def_id. into( ) ,
2067
2067
visibility: ty_vis. clean( cx) ,
2068
2068
kind: box ExternCrateItem { src: orig_name } ,
0 commit comments