@@ -44,7 +44,6 @@ use std::rc::Rc;
44
44
use std:: str;
45
45
use std:: string:: ToString ;
46
46
use std:: sync:: mpsc:: { channel, Receiver } ;
47
- use std:: sync:: Arc ;
48
47
49
48
use itertools:: Itertools ;
50
49
use rustc_ast_pretty:: pprust;
@@ -111,7 +110,7 @@ crate struct Context<'tcx> {
111
110
/// real location of an item. This is used to allow external links to
112
111
/// publicly reused items to redirect to the right location.
113
112
crate render_redirect_pages : bool ,
114
- crate shared : Arc < SharedContext < ' tcx > > ,
113
+ crate shared : Rc < SharedContext < ' tcx > > ,
115
114
/// The [`Cache`] used during rendering.
116
115
///
117
116
/// Ideally the cache would be in [`SharedContext`], but it's mutated
@@ -517,16 +516,16 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
517
516
current : Vec :: new ( ) ,
518
517
dst,
519
518
render_redirect_pages : false ,
520
- shared : Arc :: new ( scx) ,
519
+ shared : Rc :: new ( scx) ,
521
520
cache : Rc :: new ( cache) ,
522
521
} ;
523
522
524
523
CURRENT_DEPTH . with ( |s| s. set ( 0 ) ) ;
525
524
526
525
// 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 ) ;
528
527
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 ) ;
530
529
Ok ( ( cx, krate) )
531
530
}
532
531
@@ -599,7 +598,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
599
598
self . shared . fs . write ( & settings_file, v. as_bytes ( ) ) ?;
600
599
601
600
// Flush pending errors.
602
- Arc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
601
+ Rc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
603
602
let nb_errors = self . shared . errors . iter ( ) . map ( |err| diag. struct_err ( & err) . emit ( ) ) . count ( ) ;
604
603
if nb_errors > 0 {
605
604
Err ( Error :: new ( io:: Error :: new ( io:: ErrorKind :: Other , "I/O error" ) , "" ) )
0 commit comments