@@ -403,8 +403,8 @@ impl<'tcx> Clean<Type> for ty::ProjectionTy<'tcx> {
403403 Type :: QPath {
404404 name : cx. tcx . associated_item ( self . item_def_id ) . ident . name ,
405405 self_def_id : self_type. def_id ( ) ,
406- self_type : box self_type,
407- trait_ : box trait_,
406+ self_type : Box :: new ( self_type) ,
407+ trait_ : Box :: new ( trait_) ,
408408 }
409409 }
410410}
@@ -1305,8 +1305,8 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
13051305 Type :: QPath {
13061306 name : p. segments . last ( ) . expect ( "segments were empty" ) . ident . name ,
13071307 self_def_id : Some ( DefId :: local ( qself. hir_id . owner . local_def_index ) ) ,
1308- self_type : box qself. clean ( cx) ,
1309- trait_ : box resolve_type ( cx, trait_path, hir_id) ,
1308+ self_type : Box :: new ( qself. clean ( cx) ) ,
1309+ trait_ : Box :: new ( resolve_type ( cx, trait_path, hir_id) ) ,
13101310 }
13111311 }
13121312 hir:: QPath :: TypeRelative ( ref qself, ref segment) => {
@@ -1320,8 +1320,8 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
13201320 Type :: QPath {
13211321 name : segment. ident . name ,
13221322 self_def_id : res. opt_def_id ( ) ,
1323- self_type : box qself. clean ( cx) ,
1324- trait_ : box resolve_type ( cx, trait_path, hir_id) ,
1323+ self_type : Box :: new ( qself. clean ( cx) ) ,
1324+ trait_ : Box :: new ( resolve_type ( cx, trait_path, hir_id) ) ,
13251325 }
13261326 }
13271327 hir:: QPath :: LangItem ( ..) => bug ! ( "clean: requiring documentation of lang item" ) ,
@@ -1334,7 +1334,7 @@ impl Clean<Type> for hir::Ty<'_> {
13341334
13351335 match self . kind {
13361336 TyKind :: Never => Never ,
1337- TyKind :: Ptr ( ref m) => RawPointer ( m. mutbl , box m. ty . clean ( cx) ) ,
1337+ TyKind :: Ptr ( ref m) => RawPointer ( m. mutbl , Box :: new ( m. ty . clean ( cx) ) ) ,
13381338 TyKind :: Rptr ( ref l, ref m) => {
13391339 // There are two times a `Fresh` lifetime can be created:
13401340 // 1. For `&'_ x`, written by the user. This corresponds to `lower_lifetime` in `rustc_ast_lowering`.
@@ -1346,9 +1346,9 @@ impl Clean<Type> for hir::Ty<'_> {
13461346 let elided =
13471347 l. is_elided ( ) || matches ! ( l. name, LifetimeName :: Param ( ParamName :: Fresh ( _) ) ) ;
13481348 let lifetime = if elided { None } else { Some ( l. clean ( cx) ) } ;
1349- BorrowedRef { lifetime, mutability : m. mutbl , type_ : box m. ty . clean ( cx) }
1349+ BorrowedRef { lifetime, mutability : m. mutbl , type_ : Box :: new ( m. ty . clean ( cx) ) }
13501350 }
1351- TyKind :: Slice ( ref ty) => Slice ( box ty. clean ( cx) ) ,
1351+ TyKind :: Slice ( ref ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
13521352 TyKind :: Array ( ref ty, ref length) => {
13531353 let def_id = cx. tcx . hir ( ) . local_def_id ( length. hir_id ) ;
13541354 // NOTE(min_const_generics): We can't use `const_eval_poly` for constants
@@ -1361,7 +1361,7 @@ impl Clean<Type> for hir::Ty<'_> {
13611361 let ct = ty:: Const :: from_anon_const ( cx. tcx , def_id) ;
13621362 let param_env = cx. tcx . param_env ( def_id) ;
13631363 let length = print_const ( cx, ct. eval ( cx. tcx , param_env) ) ;
1364- Array ( box ty. clean ( cx) , length)
1364+ Array ( Box :: new ( ty. clean ( cx) ) , length)
13651365 }
13661366 TyKind :: Tup ( ref tys) => Tuple ( tys. clean ( cx) ) ,
13671367 TyKind :: OpaqueDef ( item_id, _) => {
@@ -1378,7 +1378,7 @@ impl Clean<Type> for hir::Ty<'_> {
13781378 let lifetime = if !lifetime. is_elided ( ) { Some ( lifetime. clean ( cx) ) } else { None } ;
13791379 DynTrait ( bounds, lifetime)
13801380 }
1381- TyKind :: BareFn ( ref barefn) => BareFunction ( box barefn. clean ( cx) ) ,
1381+ TyKind :: BareFn ( ref barefn) => BareFunction ( Box :: new ( barefn. clean ( cx) ) ) ,
13821382 TyKind :: Infer | TyKind :: Err => Infer ,
13831383 TyKind :: Typeof ( ..) => panic ! ( "unimplemented type {:?}" , self . kind) ,
13841384 }
@@ -1428,27 +1428,29 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
14281428 ty:: Uint ( uint_ty) => Primitive ( uint_ty. into ( ) ) ,
14291429 ty:: Float ( float_ty) => Primitive ( float_ty. into ( ) ) ,
14301430 ty:: Str => Primitive ( PrimitiveType :: Str ) ,
1431- ty:: Slice ( ty) => Slice ( box ty. clean ( cx) ) ,
1431+ ty:: Slice ( ty) => Slice ( Box :: new ( ty. clean ( cx) ) ) ,
14321432 ty:: Array ( ty, n) => {
14331433 let mut n = cx. tcx . lift ( n) . expect ( "array lift failed" ) ;
14341434 n = n. eval ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) ;
14351435 let n = print_const ( cx, n) ;
1436- Array ( box ty. clean ( cx) , n)
1437- }
1438- ty:: RawPtr ( mt) => RawPointer ( mt. mutbl , box mt. ty . clean ( cx) ) ,
1439- ty:: Ref ( r, ty, mutbl) => {
1440- BorrowedRef { lifetime : r. clean ( cx) , mutability : mutbl, type_ : box ty. clean ( cx) }
1436+ Array ( Box :: new ( ty. clean ( cx) ) , n)
14411437 }
1438+ ty:: RawPtr ( mt) => RawPointer ( mt. mutbl , Box :: new ( mt. ty . clean ( cx) ) ) ,
1439+ ty:: Ref ( r, ty, mutbl) => BorrowedRef {
1440+ lifetime : r. clean ( cx) ,
1441+ mutability : mutbl,
1442+ type_ : Box :: new ( ty. clean ( cx) ) ,
1443+ } ,
14421444 ty:: FnDef ( ..) | ty:: FnPtr ( _) => {
14431445 let ty = cx. tcx . lift ( * self ) . expect ( "FnPtr lift failed" ) ;
14441446 let sig = ty. fn_sig ( cx. tcx ) ;
14451447 let def_id = DefId :: local ( CRATE_DEF_INDEX ) ;
1446- BareFunction ( box BareFunctionDecl {
1448+ BareFunction ( Box :: new ( BareFunctionDecl {
14471449 unsafety : sig. unsafety ( ) ,
14481450 generic_params : Vec :: new ( ) ,
14491451 decl : ( def_id, sig) . clean ( cx) ,
14501452 abi : sig. abi ( ) ,
1451- } )
1453+ } ) )
14521454 }
14531455 ty:: Adt ( def, substs) => {
14541456 let did = def. did ;
@@ -1988,10 +1990,10 @@ fn clean_extern_crate(
19881990 // FIXME: using `from_def_id_and_kind` breaks `rustdoc/masked` for some reason
19891991 vec ! [ Item {
19901992 name: Some ( name) ,
1991- attrs: box attrs. clean( cx) ,
1993+ attrs: Box :: new ( attrs. clean( cx) ) ,
19921994 def_id: crate_def_id. into( ) ,
19931995 visibility: krate. vis. clean( cx) ,
1994- kind: box ExternCrateItem { src: orig_name } ,
1996+ kind: Box :: new ( ExternCrateItem { src: orig_name } ) ,
19951997 cfg: attrs. cfg( cx. sess( ) ) ,
19961998 } ]
19971999}
0 commit comments