@@ -4,7 +4,6 @@ use std::io;
4
4
use std:: path:: PathBuf ;
5
5
use std:: rc:: Rc ;
6
6
use std:: sync:: mpsc:: channel;
7
- use std:: sync:: Arc ;
8
7
9
8
use rustc_data_structures:: fx:: FxHashMap ;
10
9
use rustc_hir:: def_id:: LOCAL_CRATE ;
@@ -53,7 +52,7 @@ crate struct Context<'tcx> {
53
52
/// real location of an item. This is used to allow external links to
54
53
/// publicly reused items to redirect to the right location.
55
54
crate render_redirect_pages : bool ,
56
- crate shared : Arc < SharedContext < ' tcx > > ,
55
+ crate shared : Rc < SharedContext < ' tcx > > ,
57
56
/// The [`Cache`] used during rendering.
58
57
///
59
58
/// Ideally the cache would be in [`SharedContext`], but it's mutated
@@ -410,16 +409,16 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
410
409
current : Vec :: new ( ) ,
411
410
dst,
412
411
render_redirect_pages : false ,
413
- shared : Arc :: new ( scx) ,
412
+ shared : Rc :: new ( scx) ,
414
413
cache : Rc :: new ( cache) ,
415
414
} ;
416
415
417
416
CURRENT_DEPTH . with ( |s| s. set ( 0 ) ) ;
418
417
419
418
// 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 ) ;
421
420
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 ) ;
423
422
Ok ( ( cx, krate) )
424
423
}
425
424
@@ -501,7 +500,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
501
500
}
502
501
503
502
// Flush pending errors.
504
- Arc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
503
+ Rc :: get_mut ( & mut self . shared ) . unwrap ( ) . fs . close ( ) ;
505
504
let nb_errors = self . shared . errors . iter ( ) . map ( |err| diag. struct_err ( & err) . emit ( ) ) . count ( ) ;
506
505
if nb_errors > 0 {
507
506
Err ( Error :: new ( io:: Error :: new ( io:: ErrorKind :: Other , "I/O error" ) , "" ) )
0 commit comments