-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
// The visitors in this module collect sizes and counts of the most important
// pieces of AST and HIR. The resulting numbers are good approximations but not
// completely accurate (some things might be counted twice, others missed).
pub fn print_hir_stats(krate: &hir::Crate) {
let mut collector = StatCollector {
krate: Some(krate),
- data: FxHashMap(),
- seen: FxHashSet(),
+ data: FxHashMap::default(),
+ seen: FxHashSet::default(),
};
hir_visit::walk_crate(&mut collector, krate);
collector.print("HIR STATS");
pub fn print_ast_stats<'v>(krate: &'v ast::Crate, title: &str) {
let mut collector = StatCollector {
krate: None,
- data: FxHashMap(),
- seen: FxHashSet(),
+ data: FxHashMap::default(),
+ seen: FxHashSet::default(),
};
ast_visit::walk_crate(&mut collector, krate);
collector.print(title);