]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/visit_ast.rs
Use deterministic `FnvHash{Map,Set}` in rustdoc
[rust.git] / src / librustdoc / visit_ast.rs
index 0334c5ef5c4f4397120d1408d1f8aa6227c8e5f8..f6084180f0bd1814c5bb88cc071bbb0f437826d0 100644 (file)
@@ -11,7 +11,6 @@
 //! Rust AST Visitor. Extracts useful information and massages it into a form
 //! usable for clean
 
-use std::collections::HashSet;
 use std::mem;
 
 use syntax::abi;
@@ -23,6 +22,7 @@
 use rustc::hir::map as hir_map;
 use rustc::hir::def::Def;
 use rustc::middle::privacy::AccessLevel;
+use rustc::util::nodemap::FnvHashSet;
 
 use rustc::hir;
 
@@ -42,14 +42,14 @@ pub struct RustdocVisitor<'a, 'tcx: 'a> {
     pub module: Module,
     pub attrs: hir::HirVec<ast::Attribute>,
     pub cx: &'a core::DocContext<'a, 'tcx>,
-    view_item_stack: HashSet<ast::NodeId>,
+    view_item_stack: FnvHashSet<ast::NodeId>,
     inlining_from_glob: bool,
 }
 
 impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
     pub fn new(cx: &'a core::DocContext<'a, 'tcx>) -> RustdocVisitor<'a, 'tcx> {
         // If the root is reexported, terminate all recursion.
-        let mut stack = HashSet::new();
+        let mut stack = FnvHashSet();
         stack.insert(ast::CRATE_NODE_ID);
         RustdocVisitor {
             module: Module::new(None),