@@ -403,7 +403,7 @@ fn clean_projection<'tcx>(
403403 Type :: QPath {
404404 assoc : Box :: new ( projection_to_path_segment ( ty, cx) ) ,
405405 should_show_cast,
406- self_type : box self_type,
406+ self_type : Box :: new ( self_type) ,
407407 trait_,
408408 }
409409}
@@ -1321,7 +1321,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
13211321 Type :: QPath {
13221322 assoc : Box :: new ( p. segments . last ( ) . expect ( "segments were empty" ) . clean ( cx) ) ,
13231323 should_show_cast,
1324- self_type : box self_type,
1324+ self_type : Box :: new ( self_type) ,
13251325 trait_,
13261326 }
13271327 }
@@ -1341,7 +1341,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
13411341 Type :: QPath {
13421342 assoc : Box :: new ( segment. clean ( cx) ) ,
13431343 should_show_cast,
1344- self_type : box self_type,
1344+ self_type : Box :: new ( self_type) ,
13451345 trait_,
13461346 }
13471347 }
@@ -1441,7 +1441,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
14411441
14421442 match self . kind {
14431443 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) ) ) ,
14451445 TyKind :: Rptr ( ref l, ref m) => {
14461446 // There are two times a `Fresh` lifetime can be created:
14471447 // 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> {
14531453 let elided =
14541454 l. is_elided ( ) || matches ! ( l. name, LifetimeName :: Param ( _, ParamName :: Fresh ) ) ;
14551455 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) ) }
14571457 }
1458- TyKind :: Slice ( ty) => Slice ( box ty. clean ( cx) ) ,
1458+ TyKind :: Slice ( ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
14591459 TyKind :: Array ( ty, ref length) => {
14601460 let length = match length {
14611461 hir:: ArrayLen :: Infer ( _, _) => "_" . to_string ( ) ,
@@ -1474,7 +1474,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
14741474 }
14751475 } ;
14761476
1477- Array ( box ty. clean ( cx) , length)
1477+ Array ( Box :: new ( ty. clean ( cx) ) , length)
14781478 }
14791479 TyKind :: Tup ( tys) => Tuple ( tys. iter ( ) . map ( |x| x. clean ( cx) ) . collect ( ) ) ,
14801480 TyKind :: OpaqueDef ( item_id, _) => {
@@ -1491,7 +1491,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> {
14911491 let lifetime = if !lifetime. is_elided ( ) { Some ( lifetime. clean ( cx) ) } else { None } ;
14921492 DynTrait ( bounds, lifetime)
14931493 }
1494- TyKind :: BareFn ( barefn) => BareFunction ( box barefn. clean ( cx) ) ,
1494+ TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( barefn. clean ( cx) ) ) ,
14951495 // Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
14961496 TyKind :: Infer | TyKind :: Err => Infer ,
14971497 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
15411541 ty:: Uint ( uint_ty) => Primitive ( uint_ty. into ( ) ) ,
15421542 ty:: Float ( float_ty) => Primitive ( float_ty. into ( ) ) ,
15431543 ty:: Str => Primitive ( PrimitiveType :: Str ) ,
1544- ty:: Slice ( ty) => Slice ( box ty. clean ( cx) ) ,
1544+ ty:: Slice ( ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
15451545 ty:: Array ( ty, n) => {
15461546 let mut n = cx. tcx . lift ( n) . expect ( "array lift failed" ) ;
15471547 n = n. eval ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) ;
15481548 let n = print_const ( cx, n) ;
1549- Array ( box ty. clean ( cx) , n)
1549+ Array ( Box :: new ( ty. clean ( cx) ) , n)
15501550 }
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) ) ) ,
15521552 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) ) }
15541554 }
15551555 ty:: FnDef ( ..) | ty:: FnPtr ( _) => {
15561556 let ty = cx. tcx . lift ( this) . expect ( "FnPtr lift failed" ) ;
15571557 let sig = ty. fn_sig ( cx. tcx ) ;
15581558 let decl = clean_fn_decl_from_did_and_sig ( cx, None , sig) ;
1559- BareFunction ( box BareFunctionDecl {
1559+ BareFunction ( Box :: new ( BareFunctionDecl {
15601560 unsafety : sig. unsafety ( ) ,
15611561 generic_params : Vec :: new ( ) ,
15621562 decl,
15631563 abi : sig. abi ( ) ,
1564- } )
1564+ } ) )
15651565 }
15661566 ty:: Adt ( def, substs) => {
15671567 let did = def. did ( ) ;
@@ -2062,7 +2062,7 @@ fn clean_extern_crate<'tcx>(
20622062 // FIXME: using `from_def_id_and_kind` breaks `rustdoc/masked` for some reason
20632063 vec ! [ Item {
20642064 name: Some ( name) ,
2065- attrs: box attrs. clean( cx) ,
2065+ attrs: Box :: new ( attrs. clean( cx) ) ,
20662066 item_id: crate_def_id. into( ) ,
20672067 visibility: ty_vis. clean( cx) ,
20682068 kind: box ExternCrateItem { src: orig_name } ,
0 commit comments