@@ -4,7 +4,6 @@ use std::io;
44use std:: path:: PathBuf ;
55use std:: rc:: Rc ;
66use std:: sync:: mpsc:: channel;
7- use std:: sync:: Arc ;
87
98use rustc_data_structures:: fx:: FxHashMap ;
109use rustc_hir:: def_id:: LOCAL_CRATE ;
@@ -53,7 +52,7 @@ crate struct Context<'tcx> {
5352 /// real location of an item. This is used to allow external links to
5453 /// publicly reused items to redirect to the right location.
5554 crate render_redirect_pages : bool ,
56- crate shared : Arc < SharedContext < ' tcx > > ,
55+ crate shared : Rc < SharedContext < ' tcx > > ,
5756 /// The [`Cache`] used during rendering.
5857 ///
5958 /// Ideally the cache would be in [`SharedContext`], but it's mutated
@@ -410,16 +409,16 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
410409 current : Vec :: new ( ) ,
411410 dst,
412411 render_redirect_pages : false ,
413- shared : Arc :: new ( scx) ,
412+ shared : Rc :: new ( scx) ,
414413 cache : Rc :: new ( cache) ,
415414 } ;
416415
417416 CURRENT_DEPTH . with ( |s| s. set ( 0 ) ) ;
418417
419418 // Write shared runs within a flock; disable thread dispatching of IO temporarily.
420- Arc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( true ) ;
419+ Rc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( true ) ;
421420 write_shared ( & cx, & krate, index, & md_opts) ?;
422- Arc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( false ) ;
421+ Rc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( false ) ;
423422 Ok ( ( cx, krate) )
424423 }
425424
@@ -501,7 +500,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
501500 }
502501
503502 // Flush pending errors.
504- Arc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
503+ Rc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
505504 let nb_errors = self . shared . errors . iter ( ) . map ( |err| diag. struct_err ( & err) . emit ( ) ) . count ( ) ;
506505 if nb_errors > 0 {
507506 Err ( Error :: new ( io:: Error :: new ( io:: ErrorKind :: Other , "I/O error" ) , "" ) )
0 commit comments