@@ -39,10 +39,6 @@ use crate::{DOC_RUST_LANG_ORG_VERSION, try_err};
39
39
/// Major driving force in all rustdoc rendering. This contains information
40
40
/// about where in the tree-like hierarchy rendering is occurring and controls
41
41
/// 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).
46
42
pub ( crate ) struct Context < ' tcx > {
47
43
/// Current hierarchy of components leading down to what's currently being
48
44
/// rendered
@@ -60,7 +56,7 @@ pub(crate) struct Context<'tcx> {
60
56
/// Issue for improving the situation: [#82381][]
61
57
///
62
58
/// [#82381]: https://github.com/rust-lang/rust/issues/82381
63
- pub ( crate ) shared : SharedContext < ' tcx > ,
59
+ pub ( crate ) shared : Box < SharedContext < ' tcx > > ,
64
60
/// Collection of all types with notable traits referenced in the current module.
65
61
pub ( crate ) types_with_notable_traits : RefCell < FxIndexSet < clean:: Type > > ,
66
62
/// Contains information that needs to be saved and reset after rendering an item which is
@@ -552,7 +548,7 @@ impl<'tcx> Context<'tcx> {
552
548
) ;
553
549
554
550
let ( sender, receiver) = channel ( ) ;
555
- let scx = SharedContext {
551
+ let scx = Box :: new ( SharedContext {
556
552
tcx,
557
553
src_root,
558
554
local_sources,
@@ -575,7 +571,7 @@ impl<'tcx> Context<'tcx> {
575
571
call_locations,
576
572
should_merge : options. should_merge ,
577
573
expanded_codes,
578
- } ;
574
+ } ) ;
579
575
580
576
let dst = output;
581
577
scx. ensure_dir ( & dst) ?;
0 commit comments