diff options
| author | est31 <MTest31@outlook.com> | 2022-07-11 00:13:21 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-07-11 22:59:50 +0200 |
| commit | 3d2494dbf22c3f2d5c53d8d8b13a2ae4c15d785a (patch) | |
| tree | 046c2809fae462c38da4924b5c04011435a4a153 | |
| parent | 3fa637dacb78dd1a07c36df00fed2cd3e0f19d74 (diff) | |
| download | rust-3d2494dbf22c3f2d5c53d8d8b13a2ae4c15d785a.tar.gz rust-3d2494dbf22c3f2d5c53d8d8b13a2ae4c15d785a.zip | |
Remove box syntax from Box<BareFunctionDecl> construction
The type has 144 bytes according to compiler internal rustdoc.
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index cd028bc4b46..cfcedc0e4c0 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1490,7 +1490,7 @@ impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> { let lifetime = if !lifetime.is_elided() { Some(lifetime.clean(cx)) } else { None }; DynTrait(bounds, lifetime) } - TyKind::BareFn(barefn) => BareFunction(box barefn.clean(cx)), + TyKind::BareFn(barefn) => BareFunction(Box::new(barefn.clean(cx))), // Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s. TyKind::Infer | TyKind::Err => Infer, TyKind::Typeof(..) => panic!("unimplemented type {:?}", self.kind), @@ -1555,12 +1555,12 @@ fn clean_ty<'tcx>(this: Ty<'tcx>, cx: &mut DocContext<'tcx>, def_id: Option<DefI let ty = cx.tcx.lift(this).expect("FnPtr lift failed"); let sig = ty.fn_sig(cx.tcx); let decl = clean_fn_decl_from_did_and_sig(cx, None, sig); - BareFunction(box BareFunctionDecl { + BareFunction(Box::new(BareFunctionDecl { unsafety: sig.unsafety(), generic_params: Vec::new(), decl, abi: sig.abi(), - }) + })) } ty::Adt(def, substs) => { let did = def.did(); |
