about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-08-10 17:10:13 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2019-08-11 10:36:46 -0400
commiteea2f879afbaad07c562ba572482f402bc6c0006 (patch)
tree2a32a2ee84112b767b8d3839d7eed90f401a5762
parent03474801512806591c17d4477d98b883d74ed455 (diff)
downloadrust-eea2f879afbaad07c562ba572482f402bc6c0006.tar.gz
rust-eea2f879afbaad07c562ba572482f402bc6c0006.zip
Use a HashSet instead of Vec
-rw-r--r--src/librustdoc/clean/inline.rs8
-rw-r--r--src/librustdoc/core.rs2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index a8336607f7a..6f93c95edef 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -581,13 +581,11 @@ pub fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
         }
     }
 
-    cx.active_extern_traits.borrow_mut().push(did);
+    cx.active_extern_traits.borrow_mut().insert(did);
 
     debug!("record_extern_trait: {:?}", did);
     let trait_ = build_external_trait(cx, did);
 
-    {
-        cx.external_traits.borrow_mut().insert(did, trait_);
-    }
-    cx.active_extern_traits.borrow_mut().remove_item(&did);
+    cx.external_traits.borrow_mut().insert(did, trait_);
+    cx.active_extern_traits.borrow_mut().remove(&did);
 }
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index c7695fbd8d2..87381f224d0 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -51,7 +51,7 @@ pub struct DocContext<'tcx> {
     pub external_traits: Rc<RefCell<FxHashMap<DefId, clean::Trait>>>,
     /// Used while populating `external_traits` to ensure we don't process the same trait twice at
     /// the same time.
-    pub active_extern_traits: RefCell<Vec<DefId>>,
+    pub active_extern_traits: RefCell<FxHashSet<DefId>>,
     // The current set of type and lifetime substitutions,
     // for expanding type aliases at the HIR level: