File tree 7 files changed +9
-16
lines changed
7 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -3252,7 +3252,6 @@ name = "rustdoc"
3252
3252
version = " 0.0.0"
3253
3253
dependencies = [
3254
3254
" 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)" ,
3256
3255
" pulldown-cmark 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" ,
3257
3256
" rustc-rayon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" ,
3258
3257
" 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 }
13
13
minifier = " 0.0.33"
14
14
rayon = { version = " 0.2.0" , package = " rustc-rayon" }
15
15
tempfile = " 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) {
574
574
}
575
575
576
576
{
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) ||
579
578
cx. active_extern_traits . borrow ( ) . contains ( & did)
580
579
{
581
580
return ;
@@ -588,8 +587,7 @@ pub fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
588
587
let trait_ = build_external_trait ( cx, did) ;
589
588
590
589
{
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_) ;
593
591
}
594
592
cx. active_extern_traits . borrow_mut ( ) . remove_item ( & did) ;
595
593
}
Original file line number Diff line number Diff line change @@ -45,8 +45,6 @@ use std::cell::RefCell;
45
45
use std:: sync:: Arc ;
46
46
use std:: u32;
47
47
48
- use parking_lot:: ReentrantMutex ;
49
-
50
48
use crate :: core:: { self , DocContext } ;
51
49
use crate :: doctree;
52
50
use crate :: html:: render:: { cache, ExternalLocation } ;
@@ -133,7 +131,7 @@ pub struct Crate {
133
131
pub primitives : Vec < ( DefId , PrimitiveType , Attributes ) > ,
134
132
// These are later on moved into `CACHEKEY`, leaving the map empty.
135
133
// 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 > > > ,
137
135
pub masked_crates : FxHashSet < CrateNum > ,
138
136
}
139
137
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ use syntax::json::JsonEmitter;
22
22
use syntax:: symbol:: sym;
23
23
use errors;
24
24
use errors:: emitter:: { Emitter , EmitterWriter } ;
25
- use parking_lot:: ReentrantMutex ;
26
25
27
26
use std:: cell:: RefCell ;
28
27
use std:: mem;
@@ -50,7 +49,7 @@ pub struct DocContext<'tcx> {
50
49
/// Later on moved into `html::render::CACHE_KEY`
51
50
pub renderinfo : RefCell < RenderInfo > ,
52
51
/// 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 > > > ,
54
53
/// Used while populating `external_traits` to ensure we don't process the same trait twice at
55
54
/// the same time.
56
55
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 {
105
105
c. module = c. module . take ( ) . and_then ( |module| self . fold_item ( module) ) ;
106
106
107
107
{
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) | {
111
111
v. items = v. items . into_iter ( ) . filter_map ( |i| self . fold_item ( i) ) . collect ( ) ;
112
112
( k, v)
113
- } ) ) ;
113
+ } ) . collect ( ) ;
114
114
}
115
115
c
116
116
}
Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ pub fn run(mut krate: clean::Crate,
659
659
crate_version : krate. version . take ( ) ,
660
660
orphan_impl_items : Vec :: new ( ) ,
661
661
orphan_trait_impls : Vec :: new ( ) ,
662
- traits : krate. external_traits . lock ( ) . replace ( Default :: default ( ) ) ,
662
+ traits : krate. external_traits . replace ( Default :: default ( ) ) ,
663
663
deref_trait_did,
664
664
deref_mut_trait_did,
665
665
owned_box_did,
You can’t perform that action at this time.
0 commit comments