@@ -39,10 +39,6 @@ use crate::{DOC_RUST_LANG_ORG_VERSION, try_err};
3939/// Major driving force in all rustdoc rendering. This contains information
4040/// about where in the tree-like hierarchy rendering is occurring and controls
4141/// how the current page is being rendered.
42- ///
43- /// It is intended that this context is a lightweight object which can be fairly
44- /// easily cloned because it is cloned per work-job (about once per item in the
45- /// rustdoc tree).
4642pub ( crate ) struct Context < ' tcx > {
4743 /// Current hierarchy of components leading down to what's currently being
4844 /// rendered
@@ -60,7 +56,7 @@ pub(crate) struct Context<'tcx> {
6056 /// Issue for improving the situation: [#82381][]
6157 ///
6258 /// [#82381]: https://github.com/rust-lang/rust/issues/82381
63- pub ( crate ) shared : SharedContext < ' tcx > ,
59+ pub ( crate ) shared : Box < SharedContext < ' tcx > > ,
6460 /// Collection of all types with notable traits referenced in the current module.
6561 pub ( crate ) types_with_notable_traits : RefCell < FxIndexSet < clean:: Type > > ,
6662 /// Contains information that needs to be saved and reset after rendering an item which is
@@ -552,7 +548,7 @@ impl<'tcx> Context<'tcx> {
552548 ) ;
553549
554550 let ( sender, receiver) = channel ( ) ;
555- let scx = SharedContext {
551+ let scx = Box :: new ( SharedContext {
556552 tcx,
557553 src_root,
558554 local_sources,
@@ -575,7 +571,7 @@ impl<'tcx> Context<'tcx> {
575571 call_locations,
576572 should_merge : options. should_merge ,
577573 expanded_codes,
578- } ;
574+ } ) ;
579575
580576 let dst = output;
581577 scx. ensure_dir ( & dst) ?;
0 commit comments