@@ -44,7 +44,6 @@ use std::rc::Rc;
4444use std:: str;
4545use std:: string:: ToString ;
4646use std:: sync:: mpsc:: { channel, Receiver } ;
47- use std:: sync:: Arc ;
4847
4948use itertools:: Itertools ;
5049use rustc_ast_pretty:: pprust;
@@ -111,7 +110,7 @@ crate struct Context<'tcx> {
111110 /// real location of an item. This is used to allow external links to
112111 /// publicly reused items to redirect to the right location.
113112 crate render_redirect_pages : bool ,
114- crate shared : Arc < SharedContext < ' tcx > > ,
113+ crate shared : Rc < SharedContext < ' tcx > > ,
115114 /// The [`Cache`] used during rendering.
116115 ///
117116 /// Ideally the cache would be in [`SharedContext`], but it's mutated
@@ -517,16 +516,16 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
517516 current : Vec :: new ( ) ,
518517 dst,
519518 render_redirect_pages : false ,
520- shared : Arc :: new ( scx) ,
519+ shared : Rc :: new ( scx) ,
521520 cache : Rc :: new ( cache) ,
522521 } ;
523522
524523 CURRENT_DEPTH . with ( |s| s. set ( 0 ) ) ;
525524
526525 // Write shared runs within a flock; disable thread dispatching of IO temporarily.
527- Arc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( true ) ;
526+ Rc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( true ) ;
528527 write_shared ( & cx, & krate, index, & md_opts) ?;
529- Arc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( false ) ;
528+ Rc :: get_mut ( & mut cx. shared ) . unwrap ( ) . fs . set_sync_only ( false ) ;
530529 Ok ( ( cx, krate) )
531530 }
532531
@@ -599,7 +598,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
599598 self . shared . fs . write ( & settings_file, v. as_bytes ( ) ) ?;
600599
601600 // Flush pending errors.
602- Arc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
601+ Rc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
603602 let nb_errors = self . shared . errors . iter ( ) . map ( |err| diag. struct_err ( & err) . emit ( ) ) . count ( ) ;
604603 if nb_errors > 0 {
605604 Err ( Error :: new ( io:: Error :: new ( io:: ErrorKind :: Other , "I/O error" ) , "" ) )
0 commit comments