File tree Expand file tree Collapse file tree 7 files changed +9
-16
lines changed Expand file tree Collapse file tree 7 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -3252,7 +3252,6 @@ name = "rustdoc"
32523252version = " 0.0.0"
32533253dependencies = [
32543254 " minifier 0.0.33 (registry+https://github.com/rust-lang/crates.io-index)" ,
3255- " parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" ,
32563255 " pulldown-cmark 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" ,
32573256 " rustc-rayon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" ,
32583257 " tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)" ,
Original file line number Diff line number Diff line change @@ -13,4 +13,3 @@ pulldown-cmark = { version = "0.5.3", default-features = false }
1313minifier = " 0.0.33"
1414rayon = { version = " 0.2.0" , package = " rustc-rayon" }
1515tempfile = " 3"
16- parking_lot = " 0.7"
Original file line number Diff line number Diff line change @@ -574,8 +574,7 @@ pub fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
574574 }
575575
576576 {
577- let external_traits = cx. external_traits . lock ( ) ;
578- if external_traits. borrow ( ) . contains_key ( & did) ||
577+ if cx. external_traits . borrow ( ) . contains_key ( & did) ||
579578 cx. active_extern_traits . borrow ( ) . contains ( & did)
580579 {
581580 return ;
@@ -588,8 +587,7 @@ pub fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
588587 let trait_ = build_external_trait ( cx, did) ;
589588
590589 {
591- let external_traits = cx. external_traits . lock ( ) ;
592- external_traits. borrow_mut ( ) . insert ( did, trait_) ;
590+ cx. external_traits . borrow_mut ( ) . insert ( did, trait_) ;
593591 }
594592 cx. active_extern_traits . borrow_mut ( ) . remove_item ( & did) ;
595593}
Original file line number Diff line number Diff line change @@ -45,8 +45,6 @@ use std::cell::RefCell;
4545use std:: sync:: Arc ;
4646use std:: u32;
4747
48- use parking_lot:: ReentrantMutex ;
49-
5048use crate :: core:: { self , DocContext } ;
5149use crate :: doctree;
5250use crate :: html:: render:: { cache, ExternalLocation } ;
@@ -133,7 +131,7 @@ pub struct Crate {
133131 pub primitives : Vec < ( DefId , PrimitiveType , Attributes ) > ,
134132 // These are later on moved into `CACHEKEY`, leaving the map empty.
135133 // Only here so that they can be filtered through the rustdoc passes.
136- pub external_traits : Arc < ReentrantMutex < RefCell < FxHashMap < DefId , Trait > > > > ,
134+ pub external_traits : Arc < RefCell < FxHashMap < DefId , Trait > > > ,
137135 pub masked_crates : FxHashSet < CrateNum > ,
138136}
139137
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ use syntax::json::JsonEmitter;
2222use syntax:: symbol:: sym;
2323use errors;
2424use errors:: emitter:: { Emitter , EmitterWriter } ;
25- use parking_lot:: ReentrantMutex ;
2625
2726use std:: cell:: RefCell ;
2827use std:: mem;
@@ -50,7 +49,7 @@ pub struct DocContext<'tcx> {
5049 /// Later on moved into `html::render::CACHE_KEY`
5150 pub renderinfo : RefCell < RenderInfo > ,
5251 /// Later on moved through `clean::Crate` into `html::render::CACHE_KEY`
53- pub external_traits : Arc < ReentrantMutex < RefCell < FxHashMap < DefId , clean:: Trait > > > > ,
52+ pub external_traits : Arc < RefCell < FxHashMap < DefId , clean:: Trait > > > ,
5453 /// Used while populating `external_traits` to ensure we don't process the same trait twice at
5554 /// the same time.
5655 pub active_extern_traits : RefCell < Vec < DefId > > ,
Original file line number Diff line number Diff line change @@ -105,12 +105,12 @@ pub trait DocFolder : Sized {
105105 c. module = c. module . take ( ) . and_then ( |module| self . fold_item ( module) ) ;
106106
107107 {
108- let guard = c. external_traits . lock ( ) ;
109- let traits = guard . replace ( Default :: default ( ) ) ;
110- guard. borrow_mut ( ) . extend ( traits . into_iter ( ) . map ( |( k, mut v) | {
108+ let mut guard = c. external_traits . borrow_mut ( ) ;
109+ let external_traits = std :: mem :: replace ( & mut * guard , Default :: default ( ) ) ;
110+ * guard = external_traits . into_iter ( ) . map ( |( k, mut v) | {
111111 v. items = v. items . into_iter ( ) . filter_map ( |i| self . fold_item ( i) ) . collect ( ) ;
112112 ( k, v)
113- } ) ) ;
113+ } ) . collect ( ) ;
114114 }
115115 c
116116 }
Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ pub fn run(mut krate: clean::Crate,
659659 crate_version : krate. version . take ( ) ,
660660 orphan_impl_items : Vec :: new ( ) ,
661661 orphan_trait_impls : Vec :: new ( ) ,
662- traits : krate. external_traits . lock ( ) . replace ( Default :: default ( ) ) ,
662+ traits : krate. external_traits . replace ( Default :: default ( ) ) ,
663663 deref_trait_did,
664664 deref_mut_trait_did,
665665 owned_box_did,
You can’t perform that action at this time.
0 commit comments