shuffle ownership of external_traits
constraints: - clean/inline.rs needs this map to fill in traits when inlining - fold.rs needs this map to allow passes to fold trait items - html/render.rs needs this map to seed the Cache.traits map of all known traits The first two are the real problem, since `DocFolder` only operates on `clean::Crate` but `clean/inline.rs` only sees the `DocContext`. The introduction of early passes means that these two now exist at the same time, so they need to share ownership of the map. Even better, the use of `Crate` in a rustc thread pool means that it needs to be Sync, so it can't use `Lrc<Lock>` to manually activate thread-safety. `parking_lot` is reused from elsewhere in the tree to allow use of its `ReentrantMutex`, as the relevant parts of rustdoc are still single-threaded and this allows for easier use in that context.
This commit is contained in:
parent
c754e8240c
commit
354507e61f
9 changed files with 31 additions and 24 deletions
|
@ -49,6 +49,7 @@ extern crate rustc_errors as errors;
|
|||
extern crate pulldown_cmark;
|
||||
extern crate tempfile;
|
||||
extern crate minifier;
|
||||
extern crate parking_lot;
|
||||
|
||||
extern crate serialize as rustc_serialize; // used by deriving
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue