diff --git a/Cargo.lock b/Cargo.lock index 27b6adb037f..735b007025a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3698,6 +3698,7 @@ version = "0.0.0" dependencies = [ "rustc_ast", "rustc_span", + "thin-vec", ] [[package]] diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index f2258fecfea..815e00228fa 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -384,7 +384,7 @@ impl GenericParam { /// a function, enum, trait, etc. #[derive(Clone, Encodable, Decodable, Debug)] pub struct Generics { - pub params: Vec, + pub params: ThinVec, pub where_clause: WhereClause, pub span: Span, } @@ -392,7 +392,7 @@ pub struct Generics { impl Default for Generics { /// Creates an instance of `Generics`. fn default() -> Generics { - Generics { params: Vec::new(), where_clause: Default::default(), span: DUMMY_SP } + Generics { params: ThinVec::new(), where_clause: Default::default(), span: DUMMY_SP } } } @@ -441,7 +441,7 @@ impl WherePredicate { pub struct WhereBoundPredicate { pub span: Span, /// Any generics from a `for` binding. - pub bound_generic_params: Vec, + pub bound_generic_params: ThinVec, /// The type being bounded. pub bounded_ty: P, /// Trait and lifetime bounds (`Clone + Send + 'static`). @@ -1169,7 +1169,7 @@ impl Expr { pub fn to_bound(&self) -> Option { match &self.kind { ExprKind::Path(None, path) => Some(GenericBound::Trait( - PolyTraitRef::new(Vec::new(), path.clone(), self.span), + PolyTraitRef::new(ThinVec::new(), path.clone(), self.span), TraitBoundModifier::None, )), _ => None, @@ -1574,7 +1574,7 @@ pub enum ClosureBinder { /// for<'a, 'b> |_: &'a (), _: &'b ()| { ... } /// ^^^^^^ -- this /// ``` - generic_params: P<[GenericParam]>, + generic_params: ThinVec, }, } @@ -2056,7 +2056,7 @@ impl Ty { pub struct BareFnTy { pub unsafety: Unsafe, pub ext: Extern, - pub generic_params: Vec, + pub generic_params: ThinVec, pub decl: P, /// Span of the `fn(...) -> ...` part. pub decl_span: Span, @@ -2636,7 +2636,7 @@ pub struct TraitRef { #[derive(Clone, Encodable, Decodable, Debug)] pub struct PolyTraitRef { /// The `'a` in `for<'a> Foo<&'a T>`. - pub bound_generic_params: Vec, + pub bound_generic_params: ThinVec, /// The `Foo<&'a T>` in `<'a> Foo<&'a T>`. pub trait_ref: TraitRef, @@ -2645,7 +2645,7 @@ pub struct PolyTraitRef { } impl PolyTraitRef { - pub fn new(generic_params: Vec, path: Path, span: Span) -> Self { + pub fn new(generic_params: ThinVec, path: Path, span: Span) -> Self { PolyTraitRef { bound_generic_params: generic_params, trait_ref: TraitRef { path, ref_id: DUMMY_NODE_ID }, @@ -3115,15 +3115,15 @@ mod size_asserts { static_assert_size!(Block, 48); static_assert_size!(Expr, 72); static_assert_size!(ExprKind, 40); - static_assert_size!(Fn, 184); + static_assert_size!(Fn, 168); static_assert_size!(ForeignItem, 96); static_assert_size!(ForeignItemKind, 24); static_assert_size!(GenericArg, 24); - static_assert_size!(GenericBound, 72); - static_assert_size!(Generics, 72); - static_assert_size!(Impl, 184); - static_assert_size!(Item, 184); - static_assert_size!(ItemKind, 112); + static_assert_size!(GenericBound, 56); + static_assert_size!(Generics, 56); + static_assert_size!(Impl, 168); + static_assert_size!(Item, 168); + static_assert_size!(ItemKind, 96); static_assert_size!(LitKind, 24); static_assert_size!(Local, 72); static_assert_size!(MetaItemLit, 40); diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index 1dd62626b8f..6eb788a3f82 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -839,9 +839,7 @@ pub fn noop_visit_closure_binder(binder: &mut ClosureBinder, vis: match binder { ClosureBinder::NotPresent => {} ClosureBinder::For { span: _, generic_params } => { - let mut vec = std::mem::take(generic_params).into_vec(); - vec.flat_map_in_place(|param| vis.flat_map_generic_param(param)); - *generic_params = P::from_vec(vec); + generic_params.flat_map_in_place(|param| vis.flat_map_generic_param(param)); } } } diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index b543be3be50..b1b9344d253 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -66,9 +66,9 @@ use rustc_span::hygiene::MacroKind; use rustc_span::source_map::DesugaringKind; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{Span, DUMMY_SP}; - use smallvec::SmallVec; use std::collections::hash_map::Entry; +use thin_vec::ThinVec; macro_rules! arena_vec { ($this:expr; $($x:expr),*) => ( @@ -1207,7 +1207,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let (bounds, lifetime_bound) = self.with_dyn_type_scope(true, |this| { let bound = this.lower_poly_trait_ref( &PolyTraitRef { - bound_generic_params: vec![], + bound_generic_params: ThinVec::new(), trait_ref: TraitRef { path: path.clone(), ref_id: t.id }, span: t.span }, diff --git a/compiler/rustc_ast_pretty/Cargo.toml b/compiler/rustc_ast_pretty/Cargo.toml index d1513c114fe..980a8fa93a9 100644 --- a/compiler/rustc_ast_pretty/Cargo.toml +++ b/compiler/rustc_ast_pretty/Cargo.toml @@ -8,3 +8,4 @@ edition = "2021" [dependencies] rustc_ast = { path = "../rustc_ast" } rustc_span = { path = "../rustc_span" } +thin-vec = "0.2.12" diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index cd621bc67a1..5eac3c47a46 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -4,7 +4,7 @@ mod item; use crate::pp::Breaks::{Consistent, Inconsistent}; use crate::pp::{self, Breaks}; - +use rustc_ast::attr::AttrIdGenerator; use rustc_ast::ptr::P; use rustc_ast::token::{self, BinOpToken, CommentKind, Delimiter, Nonterminal, Token, TokenKind}; use rustc_ast::tokenstream::{TokenStream, TokenTree}; @@ -20,9 +20,8 @@ use rustc_span::edition::Edition; use rustc_span::source_map::{SourceMap, Spanned}; use rustc_span::symbol::{kw, sym, Ident, IdentPrinter, Symbol}; use rustc_span::{BytePos, FileName, Span, DUMMY_SP}; - -use rustc_ast::attr::AttrIdGenerator; use std::borrow::Cow; +use thin_vec::ThinVec; pub use self::delimited::IterDelimited; @@ -1722,7 +1721,7 @@ impl<'a> State<'a> { self.ibox(INDENT_UNIT); self.print_formal_generic_params(generic_params); let generics = ast::Generics { - params: Vec::new(), + params: ThinVec::new(), where_clause: ast::WhereClause { has_where_token: false, predicates: Vec::new(), diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs index 38878ba7012..33c971b1e6a 100644 --- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs @@ -177,7 +177,7 @@ use std::cell::RefCell; use std::iter; use std::ops::Not; use std::vec; -use thin_vec::thin_vec; +use thin_vec::{thin_vec, ThinVec}; use ty::{Bounds, Path, Ref, Self_, Ty}; pub mod ty; @@ -318,7 +318,7 @@ pub fn combine_substructure( } struct TypeParameter { - bound_generic_params: Vec, + bound_generic_params: ThinVec, ty: P, } @@ -385,7 +385,7 @@ fn find_type_parameters( struct Visitor<'a, 'b> { cx: &'a ExtCtxt<'b>, ty_param_names: &'a [Symbol], - bound_generic_params_stack: Vec, + bound_generic_params_stack: ThinVec, type_params: Vec, } @@ -422,7 +422,7 @@ fn find_type_parameters( let mut visitor = Visitor { cx, ty_param_names, - bound_generic_params_stack: Vec::new(), + bound_generic_params_stack: ThinVec::new(), type_params: Vec::new(), }; visit::Visitor::visit_ty(&mut visitor, ty); @@ -594,7 +594,7 @@ impl<'a> TraitDef<'a> { let span = generics.span.with_ctxt(ctxt); // Create the generic parameters - let params: Vec<_> = generics + let params: ThinVec<_> = generics .params .iter() .map(|param| match ¶m.kind { diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs index b4c12651e7a..3b73576d184 100644 --- a/compiler/rustc_expand/src/build.rs +++ b/compiler/rustc_expand/src/build.rs @@ -125,7 +125,7 @@ impl<'a> ExtCtxt<'a> { pub fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef { ast::PolyTraitRef { - bound_generic_params: Vec::new(), + bound_generic_params: ThinVec::new(), trait_ref: self.trait_ref(path), span, } diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 2fc8ce98af0..cd0453afdf1 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2095,7 +2095,7 @@ impl<'a> Parser<'a> { self.sess.gated_spans.gate(sym::closure_lifetime_binder, span); - ClosureBinder::For { span, generic_params: P::from_vec(lifetime_defs) } + ClosureBinder::For { span, generic_params: lifetime_defs } } else { ClosureBinder::NotPresent }; diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs index 23f49ec55a1..0eaa029a20d 100644 --- a/compiler/rustc_parse/src/parser/generics.rs +++ b/compiler/rustc_parse/src/parser/generics.rs @@ -14,6 +14,7 @@ use rustc_ast::{ use rustc_errors::{Applicability, PResult}; use rustc_span::symbol::{kw, Ident}; use rustc_span::Span; +use thin_vec::ThinVec; enum PredicateOrStructBody { Predicate(ast::WherePredicate), @@ -121,8 +122,8 @@ impl<'a> Parser<'a> { /// Parses a (possibly empty) list of lifetime and type parameters, possibly including /// a trailing comma and erroneous trailing attributes. - pub(super) fn parse_generic_params(&mut self) -> PResult<'a, Vec> { - let mut params = Vec::new(); + pub(super) fn parse_generic_params(&mut self) -> PResult<'a, ThinVec> { + let mut params = ThinVec::new(); let mut done = false; while !done { let attrs = self.parse_outer_attributes()?; @@ -251,7 +252,7 @@ impl<'a> Parser<'a> { self.expect_gt()?; (params, span_lo.to(self.prev_token.span)) } else { - (vec![], self.prev_token.span.shrink_to_hi()) + (ThinVec::new(), self.prev_token.span.shrink_to_hi()) }; Ok(ast::Generics { params, diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index 4f4252b532e..92c792875ab 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -21,7 +21,7 @@ use rustc_errors::{Applicability, PResult}; use rustc_span::source_map::Span; use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::Symbol; -use thin_vec::thin_vec; +use thin_vec::{thin_vec, ThinVec}; /// Any `?` or `~const` modifiers that appear at the start of a bound. struct BoundModifiers { @@ -273,7 +273,7 @@ impl<'a> Parser<'a> { TyKind::Infer } else if self.check_fn_front_matter(false, Case::Sensitive) { // Function pointer type - self.parse_ty_bare_fn(lo, Vec::new(), None, recover_return_sign)? + self.parse_ty_bare_fn(lo, ThinVec::new(), None, recover_return_sign)? } else if self.check_keyword(kw::For) { // Function pointer type or bound list (trait object type) starting with a poly-trait. // `for<'lt> [unsafe] [extern "ABI"] fn (&'lt S) -> T` @@ -352,7 +352,7 @@ impl<'a> Parser<'a> { match ty.kind { // `(TY_BOUND_NOPAREN) + BOUND + ...`. TyKind::Path(None, path) if maybe_bounds => { - self.parse_remaining_bounds_path(Vec::new(), path, lo, true) + self.parse_remaining_bounds_path(ThinVec::new(), path, lo, true) } TyKind::TraitObject(bounds, TraitObjectSyntax::None) if maybe_bounds && bounds.len() == 1 && !trailing_plus => @@ -378,7 +378,7 @@ impl<'a> Parser<'a> { fn parse_remaining_bounds_path( &mut self, - generic_params: Vec, + generic_params: ThinVec, path: ast::Path, lo: Span, parse_plus: bool, @@ -511,7 +511,7 @@ impl<'a> Parser<'a> { fn parse_ty_bare_fn( &mut self, lo: Span, - mut params: Vec, + mut params: ThinVec, param_insertion_point: Option, recover_return_sign: RecoverReturnSign, ) -> PResult<'a, TyKind> { @@ -545,13 +545,13 @@ impl<'a> Parser<'a> { fn recover_fn_ptr_with_generics( &mut self, lo: Span, - params: &mut Vec, + params: &mut ThinVec, param_insertion_point: Option, ) -> PResult<'a, ()> { let generics = self.parse_generics()?; let arity = generics.params.len(); - let mut lifetimes: Vec<_> = generics + let mut lifetimes: ThinVec<_> = generics .params .into_iter() .filter(|param| matches!(param.kind, ast::GenericParamKind::Lifetime)) @@ -662,7 +662,7 @@ impl<'a> Parser<'a> { }))) } else if allow_plus == AllowPlus::Yes && self.check_plus() { // `Trait1 + Trait2 + 'a` - self.parse_remaining_bounds_path(Vec::new(), path, lo, true) + self.parse_remaining_bounds_path(ThinVec::new(), path, lo, true) } else { // Just a type path. Ok(TyKind::Path(None, path)) @@ -993,7 +993,7 @@ impl<'a> Parser<'a> { } /// Optionally parses `for<$generic_params>`. - pub(super) fn parse_late_bound_lifetime_defs(&mut self) -> PResult<'a, Vec> { + pub(super) fn parse_late_bound_lifetime_defs(&mut self) -> PResult<'a, ThinVec> { if self.eat_keyword(kw::For) { self.expect_lt()?; let params = self.parse_generic_params()?; @@ -1002,7 +1002,7 @@ impl<'a> Parser<'a> { // parameters, and the lifetime parameters must not have bounds. Ok(params) } else { - Ok(Vec::new()) + Ok(ThinVec::new()) } } @@ -1012,7 +1012,7 @@ impl<'a> Parser<'a> { fn recover_fn_trait_with_lifetime_params( &mut self, fn_path: &mut ast::Path, - lifetime_defs: &mut Vec, + lifetime_defs: &mut ThinVec, ) -> PResult<'a, ()> { let fn_path_segment = fn_path.segments.last_mut().unwrap(); let generic_args = if let Some(p_args) = &fn_path_segment.args { @@ -1072,7 +1072,7 @@ impl<'a> Parser<'a> { kind: ast::GenericParamKind::Lifetime, colon_span: None, }) - .collect::>(); + .collect::>(); lifetime_defs.append(&mut generic_params); let generic_args_span = generic_args.span(); diff --git a/tests/ui/stats/hir-stats.stderr b/tests/ui/stats/hir-stats.stderr index 7d9ff2dfb4d..6d2d1cb15a4 100644 --- a/tests/ui/stats/hir-stats.stderr +++ b/tests/ui/stats/hir-stats.stderr @@ -1,7 +1,9 @@ ast-stats-1 PRE EXPANSION AST STATS ast-stats-1 Name Accumulated Size Count Item Size ast-stats-1 ---------------------------------------------------------------- -ast-stats-1 ExprField 48 ( 0.6%) 1 48 +ast-stats-1 ExprField 48 ( 0.7%) 1 48 +ast-stats-1 WherePredicate 56 ( 0.8%) 1 56 +ast-stats-1 - BoundPredicate 56 ( 0.8%) 1 ast-stats-1 GenericArgs 56 ( 0.8%) 1 56 ast-stats-1 - AngleBracketed 56 ( 0.8%) 1 ast-stats-1 Crate 56 ( 0.8%) 1 56 @@ -9,8 +11,6 @@ ast-stats-1 Attribute 64 ( 0.9%) 2 32 ast-stats-1 - Normal 32 ( 0.4%) 1 ast-stats-1 - DocComment 32 ( 0.4%) 1 ast-stats-1 Local 72 ( 1.0%) 1 72 -ast-stats-1 WherePredicate 72 ( 1.0%) 1 72 -ast-stats-1 - BoundPredicate 72 ( 1.0%) 1 ast-stats-1 Arm 96 ( 1.3%) 2 48 ast-stats-1 ForeignItem 96 ( 1.3%) 1 96 ast-stats-1 - Fn 96 ( 1.3%) 1 @@ -20,51 +20,51 @@ ast-stats-1 - Local 32 ( 0.4%) 1 ast-stats-1 - MacCall 32 ( 0.4%) 1 ast-stats-1 - Expr 96 ( 1.3%) 3 ast-stats-1 Param 160 ( 2.2%) 4 40 -ast-stats-1 FnDecl 200 ( 2.7%) 5 40 -ast-stats-1 Variant 240 ( 3.2%) 2 120 -ast-stats-1 GenericBound 288 ( 3.9%) 4 72 -ast-stats-1 - Trait 288 ( 3.9%) 4 -ast-stats-1 Block 288 ( 3.9%) 6 48 -ast-stats-1 AssocItem 416 ( 5.6%) 4 104 -ast-stats-1 - Type 208 ( 2.8%) 2 -ast-stats-1 - Fn 208 ( 2.8%) 2 -ast-stats-1 GenericParam 480 ( 6.5%) 5 96 -ast-stats-1 Expr 576 ( 7.8%) 8 72 +ast-stats-1 FnDecl 200 ( 2.8%) 5 40 +ast-stats-1 GenericBound 224 ( 3.1%) 4 56 +ast-stats-1 - Trait 224 ( 3.1%) 4 +ast-stats-1 Variant 240 ( 3.3%) 2 120 +ast-stats-1 Block 288 ( 4.0%) 6 48 +ast-stats-1 AssocItem 416 ( 5.8%) 4 104 +ast-stats-1 - Type 208 ( 2.9%) 2 +ast-stats-1 - Fn 208 ( 2.9%) 2 +ast-stats-1 GenericParam 480 ( 6.7%) 5 96 +ast-stats-1 Expr 576 ( 8.0%) 8 72 ast-stats-1 - Path 72 ( 1.0%) 1 ast-stats-1 - Match 72 ( 1.0%) 1 ast-stats-1 - Struct 72 ( 1.0%) 1 -ast-stats-1 - Lit 144 ( 1.9%) 2 -ast-stats-1 - Block 216 ( 2.9%) 3 -ast-stats-1 Pat 616 ( 8.3%) 7 88 +ast-stats-1 - Lit 144 ( 2.0%) 2 +ast-stats-1 - Block 216 ( 3.0%) 3 +ast-stats-1 Pat 616 ( 8.6%) 7 88 ast-stats-1 - Struct 88 ( 1.2%) 1 ast-stats-1 - Wild 88 ( 1.2%) 1 -ast-stats-1 - Ident 440 ( 5.9%) 5 -ast-stats-1 PathSegment 720 ( 9.7%) 30 24 -ast-stats-1 Ty 896 (12.1%) 14 64 +ast-stats-1 - Ident 440 ( 6.1%) 5 +ast-stats-1 PathSegment 720 (10.0%) 30 24 +ast-stats-1 Ty 896 (12.5%) 14 64 ast-stats-1 - Ptr 64 ( 0.9%) 1 ast-stats-1 - Ref 64 ( 0.9%) 1 -ast-stats-1 - ImplicitSelf 128 ( 1.7%) 2 -ast-stats-1 - Path 640 ( 8.6%) 10 -ast-stats-1 Item 1_656 (22.3%) 9 184 -ast-stats-1 - Trait 184 ( 2.5%) 1 -ast-stats-1 - Enum 184 ( 2.5%) 1 -ast-stats-1 - ForeignMod 184 ( 2.5%) 1 -ast-stats-1 - Impl 184 ( 2.5%) 1 -ast-stats-1 - Fn 368 ( 5.0%) 2 -ast-stats-1 - Use 552 ( 7.4%) 3 +ast-stats-1 - ImplicitSelf 128 ( 1.8%) 2 +ast-stats-1 - Path 640 ( 8.9%) 10 +ast-stats-1 Item 1_512 (21.0%) 9 168 +ast-stats-1 - Trait 168 ( 2.3%) 1 +ast-stats-1 - Enum 168 ( 2.3%) 1 +ast-stats-1 - ForeignMod 168 ( 2.3%) 1 +ast-stats-1 - Impl 168 ( 2.3%) 1 +ast-stats-1 - Fn 336 ( 4.7%) 2 +ast-stats-1 - Use 504 ( 7.0%) 3 ast-stats-1 ---------------------------------------------------------------- -ast-stats-1 Total 7_416 +ast-stats-1 Total 7_192 ast-stats-1 ast-stats-2 POST EXPANSION AST STATS ast-stats-2 Name Accumulated Size Count Item Size ast-stats-2 ---------------------------------------------------------------- ast-stats-2 ExprField 48 ( 0.6%) 1 48 +ast-stats-2 WherePredicate 56 ( 0.7%) 1 56 +ast-stats-2 - BoundPredicate 56 ( 0.7%) 1 ast-stats-2 GenericArgs 56 ( 0.7%) 1 56 ast-stats-2 - AngleBracketed 56 ( 0.7%) 1 ast-stats-2 Crate 56 ( 0.7%) 1 56 ast-stats-2 Local 72 ( 0.9%) 1 72 -ast-stats-2 WherePredicate 72 ( 0.9%) 1 72 -ast-stats-2 - BoundPredicate 72 ( 0.9%) 1 ast-stats-2 Arm 96 ( 1.2%) 2 48 ast-stats-2 ForeignItem 96 ( 1.2%) 1 96 ast-stats-2 - Fn 96 ( 1.2%) 1 @@ -79,41 +79,41 @@ ast-stats-2 - Semi 32 ( 0.4%) 1 ast-stats-2 - Expr 96 ( 1.2%) 3 ast-stats-2 Param 160 ( 2.0%) 4 40 ast-stats-2 FnDecl 200 ( 2.5%) 5 40 -ast-stats-2 Variant 240 ( 3.0%) 2 120 -ast-stats-2 GenericBound 288 ( 3.6%) 4 72 -ast-stats-2 - Trait 288 ( 3.6%) 4 -ast-stats-2 Block 288 ( 3.6%) 6 48 -ast-stats-2 AssocItem 416 ( 5.1%) 4 104 +ast-stats-2 GenericBound 224 ( 2.9%) 4 56 +ast-stats-2 - Trait 224 ( 2.9%) 4 +ast-stats-2 Variant 240 ( 3.1%) 2 120 +ast-stats-2 Block 288 ( 3.7%) 6 48 +ast-stats-2 AssocItem 416 ( 5.3%) 4 104 ast-stats-2 - Type 208 ( 2.6%) 2 ast-stats-2 - Fn 208 ( 2.6%) 2 -ast-stats-2 GenericParam 480 ( 5.9%) 5 96 -ast-stats-2 Pat 616 ( 7.6%) 7 88 +ast-stats-2 GenericParam 480 ( 6.1%) 5 96 +ast-stats-2 Pat 616 ( 7.8%) 7 88 ast-stats-2 - Struct 88 ( 1.1%) 1 ast-stats-2 - Wild 88 ( 1.1%) 1 -ast-stats-2 - Ident 440 ( 5.4%) 5 -ast-stats-2 Expr 648 ( 8.0%) 9 72 +ast-stats-2 - Ident 440 ( 5.6%) 5 +ast-stats-2 Expr 648 ( 8.2%) 9 72 ast-stats-2 - Path 72 ( 0.9%) 1 ast-stats-2 - Match 72 ( 0.9%) 1 ast-stats-2 - Struct 72 ( 0.9%) 1 ast-stats-2 - InlineAsm 72 ( 0.9%) 1 ast-stats-2 - Lit 144 ( 1.8%) 2 ast-stats-2 - Block 216 ( 2.7%) 3 -ast-stats-2 PathSegment 792 ( 9.8%) 33 24 -ast-stats-2 Ty 896 (11.0%) 14 64 +ast-stats-2 PathSegment 792 (10.1%) 33 24 +ast-stats-2 Ty 896 (11.4%) 14 64 ast-stats-2 - Ptr 64 ( 0.8%) 1 ast-stats-2 - Ref 64 ( 0.8%) 1 ast-stats-2 - ImplicitSelf 128 ( 1.6%) 2 -ast-stats-2 - Path 640 ( 7.9%) 10 -ast-stats-2 Item 2_024 (25.0%) 11 184 -ast-stats-2 - Trait 184 ( 2.3%) 1 -ast-stats-2 - Enum 184 ( 2.3%) 1 -ast-stats-2 - ExternCrate 184 ( 2.3%) 1 -ast-stats-2 - ForeignMod 184 ( 2.3%) 1 -ast-stats-2 - Impl 184 ( 2.3%) 1 -ast-stats-2 - Fn 368 ( 4.5%) 2 -ast-stats-2 - Use 736 ( 9.1%) 4 +ast-stats-2 - Path 640 ( 8.1%) 10 +ast-stats-2 Item 1_848 (23.5%) 11 168 +ast-stats-2 - Trait 168 ( 2.1%) 1 +ast-stats-2 - Enum 168 ( 2.1%) 1 +ast-stats-2 - ExternCrate 168 ( 2.1%) 1 +ast-stats-2 - ForeignMod 168 ( 2.1%) 1 +ast-stats-2 - Impl 168 ( 2.1%) 1 +ast-stats-2 - Fn 336 ( 4.3%) 2 +ast-stats-2 - Use 672 ( 8.6%) 4 ast-stats-2 ---------------------------------------------------------------- -ast-stats-2 Total 8_112 +ast-stats-2 Total 7_856 ast-stats-2 hir-stats HIR STATS hir-stats Name Accumulated Size Count Item Size