diff --git a/Cargo.lock b/Cargo.lock index c867bb4ceaa..e1359b9e9e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3476,6 +3476,7 @@ dependencies = [ "rustc_session", "rustc_span", "smallvec", + "thin-vec", "tracing", ] @@ -3916,6 +3917,7 @@ dependencies = [ "rustc_macros", "rustc_session", "rustc_span", + "thin-vec", "tracing", "unicode-normalization", "unicode-width", @@ -4051,6 +4053,7 @@ dependencies = [ "rustc_session", "rustc_span", "smallvec", + "thin-vec", "tracing", ] diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index a9b3aa1d560..e6b72bd58c5 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -36,7 +36,7 @@ use rustc_span::{Span, DUMMY_SP}; use std::convert::TryFrom; use std::fmt; use std::mem; -use thin_vec::ThinVec; +use thin_vec::{thin_vec, ThinVec}; /// A "Label" is an identifier of some point in sources, /// e.g. in the following code: @@ -90,7 +90,7 @@ pub struct Path { pub span: Span, /// The segments in the path: the things separated by `::`. /// Global paths begin with `kw::PathRoot`. - pub segments: Vec, + pub segments: ThinVec, pub tokens: Option, } @@ -114,7 +114,7 @@ impl Path { // Convert a span and an identifier to the corresponding // one-segment path. pub fn from_ident(ident: Ident) -> Path { - Path { segments: vec![PathSegment::from_ident(ident)], span: ident.span, tokens: None } + Path { segments: thin_vec![PathSegment::from_ident(ident)], span: ident.span, tokens: None } } pub fn is_global(&self) -> bool { @@ -3046,28 +3046,28 @@ mod size_asserts { static_assert_size!(AssocItemKind, 32); static_assert_size!(Attribute, 32); static_assert_size!(Block, 48); - static_assert_size!(Expr, 88); - static_assert_size!(ExprKind, 56); + static_assert_size!(Expr, 72); + static_assert_size!(ExprKind, 40); static_assert_size!(Fn, 184); static_assert_size!(ForeignItem, 96); static_assert_size!(ForeignItemKind, 24); static_assert_size!(GenericArg, 24); - static_assert_size!(GenericBound, 88); + static_assert_size!(GenericBound, 72); static_assert_size!(Generics, 72); - static_assert_size!(Impl, 200); + static_assert_size!(Impl, 184); static_assert_size!(Item, 184); static_assert_size!(ItemKind, 112); static_assert_size!(Lit, 48); static_assert_size!(LitKind, 24); static_assert_size!(Local, 72); static_assert_size!(Param, 40); - static_assert_size!(Pat, 104); - static_assert_size!(Path, 40); + static_assert_size!(Pat, 88); + static_assert_size!(Path, 24); static_assert_size!(PathSegment, 24); - static_assert_size!(PatKind, 80); + static_assert_size!(PatKind, 64); static_assert_size!(Stmt, 32); static_assert_size!(StmtKind, 16); - static_assert_size!(Ty, 80); - static_assert_size!(TyKind, 56); + static_assert_size!(Ty, 64); + static_assert_size!(TyKind, 40); // tidy-alphabetical-end } diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index 07f982b7e86..09b08d5059c 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -10,19 +10,18 @@ use crate::token::{self, CommentKind, Delimiter, Token}; use crate::tokenstream::{DelimSpan, Spacing, TokenTree}; use crate::tokenstream::{LazyAttrTokenStream, TokenStream}; use crate::util::comments; - use rustc_data_structures::sync::WorkerLocal; use rustc_index::bit_set::GrowableBitSet; use rustc_span::source_map::BytePos; use rustc_span::symbol::{sym, Ident, Symbol}; use rustc_span::Span; - use std::cell::Cell; use std::iter; #[cfg(debug_assertions)] use std::ops::BitXor; #[cfg(debug_assertions)] use std::sync::atomic::{AtomicU32, Ordering}; +use thin_vec::thin_vec; pub struct MarkedAttrs(GrowableBitSet); @@ -471,12 +470,12 @@ impl MetaItem { tokens.peek() { tokens.next(); - vec![PathSegment::from_ident(Ident::new(name, span))] + thin_vec![PathSegment::from_ident(Ident::new(name, span))] } else { break 'arm Path::from_ident(Ident::new(name, span)); } } else { - vec![PathSegment::path_root(span)] + thin_vec![PathSegment::path_root(span)] }; loop { if let Some(TokenTree::Token(Token { kind: token::Ident(name, _), span }, _)) = diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 76316a574ac..18d5e70ecb0 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -20,8 +20,8 @@ use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::{Span, Symbol}; use rustc_target::spec::abi; use smallvec::{smallvec, SmallVec}; - use std::iter; +use thin_vec::ThinVec; pub(super) struct ItemLowerer<'a, 'hir> { pub(super) tcx: TyCtxt<'hir>, @@ -243,7 +243,7 @@ impl<'hir> LoweringContext<'_, 'hir> { ItemKind::ExternCrate(orig_name) => hir::ItemKind::ExternCrate(orig_name), ItemKind::Use(ref use_tree) => { // Start with an empty prefix. - let prefix = Path { segments: vec![], span: use_tree.span, tokens: None }; + let prefix = Path { segments: ThinVec::new(), span: use_tree.span, tokens: None }; self.lower_use_tree(use_tree, &prefix, id, vis_span, ident, attrs) } diff --git a/compiler/rustc_expand/Cargo.toml b/compiler/rustc_expand/Cargo.toml index 4ee7b6c42bb..192f54171ce 100644 --- a/compiler/rustc_expand/Cargo.toml +++ b/compiler/rustc_expand/Cargo.toml @@ -8,20 +8,21 @@ build = false doctest = false [dependencies] -rustc_serialize = { path = "../rustc_serialize" } -tracing = "0.1" -rustc_span = { path = "../rustc_span" } -rustc_ast_pretty = { path = "../rustc_ast_pretty" } +crossbeam-channel = "0.5.0" rustc_ast_passes = { path = "../rustc_ast_passes" } +rustc_ast = { path = "../rustc_ast" } +rustc_ast_pretty = { path = "../rustc_ast_pretty" } rustc_attr = { path = "../rustc_attr" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_errors = { path = "../rustc_errors" } rustc_feature = { path = "../rustc_feature" } +rustc_lexer = { path = "../rustc_lexer" } rustc_lint_defs = { path = "../rustc_lint_defs" } rustc_macros = { path = "../rustc_macros" } -rustc_lexer = { path = "../rustc_lexer" } rustc_parse = { path = "../rustc_parse" } +rustc_serialize = { path = "../rustc_serialize" } rustc_session = { path = "../rustc_session" } +rustc_span = { path = "../rustc_span" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } -rustc_ast = { path = "../rustc_ast" } -crossbeam-channel = "0.5.0" +thin-vec = "0.2.8" +tracing = "0.1" diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs index 03dbc07e5dc..e17cba1478a 100644 --- a/compiler/rustc_expand/src/build.rs +++ b/compiler/rustc_expand/src/build.rs @@ -1,13 +1,12 @@ use crate::base::ExtCtxt; - use rustc_ast::attr; use rustc_ast::ptr::P; use rustc_ast::{self as ast, AttrVec, BlockCheckMode, Expr, LocalKind, PatKind, UnOp}; use rustc_data_structures::sync::Lrc; use rustc_span::source_map::Spanned; use rustc_span::symbol::{kw, sym, Ident, Symbol}; - use rustc_span::Span; +use thin_vec::ThinVec; impl<'a> ExtCtxt<'a> { pub fn path(&self, span: Span, strs: Vec) -> ast::Path { @@ -28,7 +27,7 @@ impl<'a> ExtCtxt<'a> { ) -> ast::Path { assert!(!idents.is_empty()); let add_root = global && !idents[0].is_path_segment_keyword(); - let mut segments = Vec::with_capacity(idents.len() + add_root as usize); + let mut segments = ThinVec::with_capacity(idents.len() + add_root as usize); if add_root { segments.push(ast::PathSegment::path_root(span)); } diff --git a/compiler/rustc_expand/src/placeholders.rs b/compiler/rustc_expand/src/placeholders.rs index faaf3b3fea5..97b1871028e 100644 --- a/compiler/rustc_expand/src/placeholders.rs +++ b/compiler/rustc_expand/src/placeholders.rs @@ -1,14 +1,12 @@ use crate::expand::{AstFragment, AstFragmentKind}; - use rustc_ast as ast; use rustc_ast::mut_visit::*; use rustc_ast::ptr::P; +use rustc_data_structures::fx::FxHashMap; use rustc_span::source_map::DUMMY_SP; use rustc_span::symbol::Ident; - use smallvec::{smallvec, SmallVec}; - -use rustc_data_structures::fx::FxHashMap; +use thin_vec::ThinVec; pub fn placeholder( kind: AstFragmentKind, @@ -17,7 +15,7 @@ pub fn placeholder( ) -> AstFragment { fn mac_placeholder() -> P { P(ast::MacCall { - path: ast::Path { span: DUMMY_SP, segments: Vec::new(), tokens: None }, + path: ast::Path { span: DUMMY_SP, segments: ThinVec::new(), tokens: None }, args: P(ast::MacArgs::Empty), prior_type_ascription: None, }) diff --git a/compiler/rustc_parse/Cargo.toml b/compiler/rustc_parse/Cargo.toml index a5c94e16403..dbcfb390333 100644 --- a/compiler/rustc_parse/Cargo.toml +++ b/compiler/rustc_parse/Cargo.toml @@ -7,15 +7,16 @@ edition = "2021" [dependencies] bitflags = "1.0" -tracing = "0.1" +rustc_ast = { path = "../rustc_ast" } rustc_ast_pretty = { path = "../rustc_ast_pretty" } rustc_data_structures = { path = "../rustc_data_structures" } +rustc_errors = { path = "../rustc_errors" } rustc_feature = { path = "../rustc_feature" } rustc_lexer = { path = "../rustc_lexer" } rustc_macros = { path = "../rustc_macros" } -rustc_errors = { path = "../rustc_errors" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } -rustc_ast = { path = "../rustc_ast" } +thin-vec = "0.2.8" +tracing = "0.1" unicode-normalization = "0.1.11" unicode-width = "0.1.4" diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 3352e0a6c69..350b270cc3d 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -18,6 +18,7 @@ use crate::errors::{ }; use crate::lexer::UnmatchedBrace; +use crate::parser; use rustc_ast as ast; use rustc_ast::ptr::P; use rustc_ast::token::{self, Delimiter, Lit, LitKind, TokenKind}; @@ -37,11 +38,10 @@ use rustc_session::errors::ExprParenthesesNeeded; use rustc_span::source_map::Spanned; use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::{Span, SpanSnippetError, DUMMY_SP}; -use std::ops::{Deref, DerefMut}; - use std::mem::take; - -use crate::parser; +use std::ops::{Deref, DerefMut}; +use thin_vec::{thin_vec, ThinVec}; +use tracing::{debug, trace}; /// Creates a placeholder argument. pub(super) fn dummy_arg(ident: Ident) -> Param { @@ -638,8 +638,11 @@ impl<'a> Parser<'a> { // field: value, // } let mut snapshot = self.create_snapshot_for_diagnostic(); - let path = - Path { segments: vec![], span: self.prev_token.span.shrink_to_lo(), tokens: None }; + let path = Path { + segments: ThinVec::new(), + span: self.prev_token.span.shrink_to_lo(), + tokens: None, + }; let struct_expr = snapshot.parse_struct_expr(None, path, false); let block_tail = self.parse_block_tail(lo, s, AttemptLocalParseRecovery::No); return Some(match (struct_expr, block_tail) { @@ -1426,7 +1429,7 @@ impl<'a> Parser<'a> { ) -> PResult<'a, P> { self.expect(&token::ModSep)?; - let mut path = ast::Path { segments: Vec::new(), span: DUMMY_SP, tokens: None }; + let mut path = ast::Path { segments: ThinVec::new(), span: DUMMY_SP, tokens: None }; self.parse_path_segments(&mut path.segments, T::PATH_STYLE, None)?; path.span = ty_span.to(self.prev_token.span); @@ -2434,7 +2437,7 @@ impl<'a> Parser<'a> { None, Path { span: new_span, - segments: vec![ + segments: thin_vec![ PathSegment::from_ident(*old_ident), PathSegment::from_ident(*ident), ], diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 494f0cf56a8..e5f58ca3894 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -3,7 +3,6 @@ use crate::errors::{DocCommentDoesNotDocumentAnything, UseEmptyBlockNotSemi}; use super::diagnostics::{dummy_arg, ConsumeClosingDelim}; use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign}; use super::{AttrWrapper, FollowedByType, ForceCollect, Parser, PathStyle, TrailingToken}; - use rustc_ast::ast::*; use rustc_ast::ptr::P; use rustc_ast::token::{self, Delimiter, TokenKind}; @@ -22,9 +21,10 @@ use rustc_span::lev_distance::lev_distance; use rustc_span::source_map::{self, Span}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::DUMMY_SP; - use std::convert::TryFrom; use std::mem; +use thin_vec::ThinVec; +use tracing::debug; impl<'a> Parser<'a> { /// Parses a source module as a crate. This is the main entry point for the parser. @@ -972,7 +972,8 @@ impl<'a> Parser<'a> { fn parse_use_tree(&mut self) -> PResult<'a, UseTree> { let lo = self.token.span; - let mut prefix = ast::Path { segments: Vec::new(), span: lo.shrink_to_lo(), tokens: None }; + let mut prefix = + ast::Path { segments: ThinVec::new(), span: lo.shrink_to_lo(), tokens: None }; let kind = if self.check(&token::OpenDelim(Delimiter::Brace)) || self.check(&token::BinOp(token::Star)) || self.is_import_coupler() diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index c2d4d218a5b..2d432e3f5bd 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -11,8 +11,9 @@ use rustc_ast::{ use rustc_errors::{pluralize, Applicability, PResult}; use rustc_span::source_map::{BytePos, Span}; use rustc_span::symbol::{kw, sym, Ident}; - use std::mem; +use thin_vec::ThinVec; +use tracing::debug; /// Specifies how to parse a path. #[derive(Copy, Clone, PartialEq)] @@ -63,7 +64,7 @@ impl<'a> Parser<'a> { path_span = path_lo.to(self.prev_token.span); } else { path_span = self.token.span.to(self.token.span); - path = ast::Path { segments: Vec::new(), span: path_span, tokens: None }; + path = ast::Path { segments: ThinVec::new(), span: path_span, tokens: None }; } // See doc comment for `unmatched_angle_bracket_count`. @@ -179,7 +180,7 @@ impl<'a> Parser<'a> { } let lo = self.token.span; - let mut segments = Vec::new(); + let mut segments = ThinVec::new(); let mod_sep_ctxt = self.token.span.ctxt(); if self.eat(&token::ModSep) { segments.push(PathSegment::path_root(lo.shrink_to_lo().with_ctxt(mod_sep_ctxt))); @@ -191,7 +192,7 @@ impl<'a> Parser<'a> { pub(super) fn parse_path_segments( &mut self, - segments: &mut Vec, + segments: &mut ThinVec, style: PathStyle, ty_generics: Option<&Generics>, ) -> PResult<'a, ()> { diff --git a/compiler/rustc_resolve/Cargo.toml b/compiler/rustc_resolve/Cargo.toml index d66db1d7a0d..b97f4560c37 100644 --- a/compiler/rustc_resolve/Cargo.toml +++ b/compiler/rustc_resolve/Cargo.toml @@ -7,10 +7,8 @@ edition = "2021" [dependencies] bitflags = "1.2.1" -tracing = "0.1" -rustc_ast = { path = "../rustc_ast" } rustc_arena = { path = "../rustc_arena" } -rustc_middle = { path = "../rustc_middle" } +rustc_ast = { path = "../rustc_ast" } rustc_ast_pretty = { path = "../rustc_ast_pretty" } rustc_attr = { path = "../rustc_attr" } rustc_data_structures = { path = "../rustc_data_structures" } @@ -20,7 +18,10 @@ rustc_feature = { path = "../rustc_feature" } rustc_hir = { path = "../rustc_hir" } rustc_index = { path = "../rustc_index" } rustc_metadata = { path = "../rustc_metadata" } +rustc_middle = { path = "../rustc_middle" } rustc_query_system = { path = "../rustc_query_system" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } +thin-vec = "0.2.8" +tracing = "0.1" diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index a12918b2979..5482e1ccefa 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -25,6 +25,7 @@ use rustc_span::lev_distance::find_best_match_for_name; use rustc_span::source_map::SourceMap; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{BytePos, Span, SyntaxContext}; +use thin_vec::ThinVec; use crate::imports::{Import, ImportKind, ImportResolver}; use crate::late::{PatternSource, Rib}; @@ -1295,7 +1296,7 @@ impl<'a> Resolver<'a> { { let mut candidates = Vec::new(); let mut seen_modules = FxHashSet::default(); - let mut worklist = vec![(start_module, Vec::::new(), true)]; + let mut worklist = vec![(start_module, ThinVec::::new(), true)]; let mut worklist_via_import = vec![]; while let Some((in_module, path_segments, accessible)) = match worklist.pop() { diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 06b60fc8602..e0c927dd1e7 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -33,6 +33,8 @@ use rustc_span::{BytePos, Span}; use std::iter; use std::ops::Deref; +use thin_vec::ThinVec; + type Res = def::Res; /// A field or associated item from self type suggested in case of resolution failure. @@ -78,7 +80,7 @@ fn import_candidate_to_enum_paths(suggestion: &ImportSuggestion) -> (String, Str let path_len = suggestion.path.segments.len(); let enum_path = ast::Path { span: suggestion.path.span, - segments: suggestion.path.segments[0..path_len - 1].to_vec(), + segments: suggestion.path.segments[0..path_len - 1].iter().cloned().collect(), tokens: None, }; let enum_path_string = path_names_to_string(&enum_path); @@ -1831,7 +1833,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { fn find_module(&mut self, def_id: DefId) -> Option<(Module<'a>, ImportSuggestion)> { let mut result = None; let mut seen_modules = FxHashSet::default(); - let mut worklist = vec![(self.r.graph_root, Vec::new())]; + let mut worklist = vec![(self.r.graph_root, ThinVec::new())]; while let Some((in_module, path_segments)) = worklist.pop() { // abort if the module is already found diff --git a/src/test/ui-fulldeps/pprust-expr-roundtrip.rs b/src/test/ui-fulldeps/pprust-expr-roundtrip.rs index c68ae63ddb3..d6dc179da7f 100644 --- a/src/test/ui-fulldeps/pprust-expr-roundtrip.rs +++ b/src/test/ui-fulldeps/pprust-expr-roundtrip.rs @@ -25,6 +25,7 @@ extern crate rustc_data_structures; extern crate rustc_parse; extern crate rustc_session; extern crate rustc_span; +extern crate thin_vec; use rustc_ast::mut_visit::{self, visit_clobber, MutVisitor}; use rustc_ast::ptr::P; @@ -35,6 +36,7 @@ use rustc_session::parse::ParseSess; use rustc_span::source_map::FilePathMapping; use rustc_span::source_map::{FileName, Spanned, DUMMY_SP}; use rustc_span::symbol::Ident; +use thin_vec::thin_vec; fn parse_expr(ps: &ParseSess, src: &str) -> Option> { let src_as_string = src.to_string(); @@ -51,7 +53,7 @@ fn expr(kind: ExprKind) -> P { fn make_x() -> P { let seg = PathSegment::from_ident(Ident::from_str("x")); - let path = Path { segments: vec![seg], span: DUMMY_SP, tokens: None }; + let path = Path { segments: thin_vec![seg], span: DUMMY_SP, tokens: None }; expr(ExprKind::Path(None, path)) } diff --git a/src/test/ui/stats/hir-stats.stderr b/src/test/ui/stats/hir-stats.stderr index c61e8254385..109306cd7af 100644 --- a/src/test/ui/stats/hir-stats.stderr +++ b/src/test/ui/stats/hir-stats.stderr @@ -2,118 +2,118 @@ 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 Crate 56 ( 0.7%) 1 56 -ast-stats-1 Attribute 64 ( 0.8%) 2 32 +ast-stats-1 Crate 56 ( 0.8%) 1 56 +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 GenericArgs 64 ( 0.8%) 1 64 -ast-stats-1 - AngleBracketed 64 ( 0.8%) 1 -ast-stats-1 Local 72 ( 0.9%) 1 72 -ast-stats-1 WherePredicate 72 ( 0.9%) 1 72 -ast-stats-1 - BoundPredicate 72 ( 0.9%) 1 -ast-stats-1 Arm 96 ( 1.2%) 2 48 -ast-stats-1 ForeignItem 96 ( 1.2%) 1 96 -ast-stats-1 - Fn 96 ( 1.2%) 1 -ast-stats-1 FieldDef 160 ( 2.0%) 2 80 -ast-stats-1 Stmt 160 ( 2.0%) 5 32 +ast-stats-1 GenericArgs 64 ( 0.9%) 1 64 +ast-stats-1 - AngleBracketed 64 ( 0.9%) 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 +ast-stats-1 FieldDef 160 ( 2.2%) 2 80 +ast-stats-1 Stmt 160 ( 2.2%) 5 32 ast-stats-1 - Local 32 ( 0.4%) 1 ast-stats-1 - MacCall 32 ( 0.4%) 1 -ast-stats-1 - Expr 96 ( 1.2%) 3 -ast-stats-1 Param 160 ( 2.0%) 4 40 -ast-stats-1 FnDecl 200 ( 2.5%) 5 40 -ast-stats-1 Variant 240 ( 3.0%) 2 120 -ast-stats-1 Block 288 ( 3.6%) 6 48 -ast-stats-1 GenericBound 352 ( 4.4%) 4 88 -ast-stats-1 - Trait 352 ( 4.4%) 4 -ast-stats-1 AssocItem 416 ( 5.2%) 4 104 -ast-stats-1 - Type 208 ( 2.6%) 2 -ast-stats-1 - Fn 208 ( 2.6%) 2 -ast-stats-1 GenericParam 480 ( 6.0%) 5 96 -ast-stats-1 Expr 704 ( 8.9%) 8 88 -ast-stats-1 - Path 88 ( 1.1%) 1 -ast-stats-1 - Match 88 ( 1.1%) 1 -ast-stats-1 - Struct 88 ( 1.1%) 1 -ast-stats-1 - Lit 176 ( 2.2%) 2 -ast-stats-1 - Block 264 ( 3.3%) 3 -ast-stats-1 PathSegment 720 ( 9.1%) 30 24 -ast-stats-1 Pat 728 ( 9.2%) 7 104 -ast-stats-1 - Struct 104 ( 1.3%) 1 -ast-stats-1 - Wild 104 ( 1.3%) 1 -ast-stats-1 - Ident 520 ( 6.5%) 5 -ast-stats-1 Ty 1_120 (14.1%) 14 80 -ast-stats-1 - Rptr 80 ( 1.0%) 1 -ast-stats-1 - Ptr 80 ( 1.0%) 1 -ast-stats-1 - ImplicitSelf 160 ( 2.0%) 2 -ast-stats-1 - Path 800 (10.1%) 10 -ast-stats-1 Item 1_656 (20.8%) 9 184 -ast-stats-1 - Trait 184 ( 2.3%) 1 -ast-stats-1 - Enum 184 ( 2.3%) 1 -ast-stats-1 - ForeignMod 184 ( 2.3%) 1 -ast-stats-1 - Impl 184 ( 2.3%) 1 -ast-stats-1 - Fn 368 ( 4.6%) 2 -ast-stats-1 - Use 552 ( 6.9%) 3 +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 - 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 - 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 - Rptr 64 ( 0.9%) 1 +ast-stats-1 - Ptr 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 ---------------------------------------------------------------- -ast-stats-1 Total 7_952 +ast-stats-1 Total 7_424 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 Crate 56 ( 0.6%) 1 56 -ast-stats-2 GenericArgs 64 ( 0.7%) 1 64 -ast-stats-2 - AngleBracketed 64 ( 0.7%) 1 -ast-stats-2 Local 72 ( 0.8%) 1 72 -ast-stats-2 WherePredicate 72 ( 0.8%) 1 72 -ast-stats-2 - BoundPredicate 72 ( 0.8%) 1 -ast-stats-2 Arm 96 ( 1.1%) 2 48 -ast-stats-2 ForeignItem 96 ( 1.1%) 1 96 -ast-stats-2 - Fn 96 ( 1.1%) 1 -ast-stats-2 InlineAsm 120 ( 1.4%) 1 120 -ast-stats-2 Attribute 128 ( 1.5%) 4 32 +ast-stats-2 Crate 56 ( 0.7%) 1 56 +ast-stats-2 GenericArgs 64 ( 0.8%) 1 64 +ast-stats-2 - AngleBracketed 64 ( 0.8%) 1 +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 +ast-stats-2 InlineAsm 120 ( 1.5%) 1 120 +ast-stats-2 Attribute 128 ( 1.6%) 4 32 ast-stats-2 - DocComment 32 ( 0.4%) 1 -ast-stats-2 - Normal 96 ( 1.1%) 3 -ast-stats-2 FieldDef 160 ( 1.8%) 2 80 -ast-stats-2 Stmt 160 ( 1.8%) 5 32 +ast-stats-2 - Normal 96 ( 1.2%) 3 +ast-stats-2 FieldDef 160 ( 2.0%) 2 80 +ast-stats-2 Stmt 160 ( 2.0%) 5 32 ast-stats-2 - Local 32 ( 0.4%) 1 ast-stats-2 - Semi 32 ( 0.4%) 1 -ast-stats-2 - Expr 96 ( 1.1%) 3 -ast-stats-2 Param 160 ( 1.8%) 4 40 -ast-stats-2 FnDecl 200 ( 2.3%) 5 40 -ast-stats-2 Variant 240 ( 2.8%) 2 120 -ast-stats-2 Block 288 ( 3.3%) 6 48 -ast-stats-2 GenericBound 352 ( 4.1%) 4 88 -ast-stats-2 - Trait 352 ( 4.1%) 4 -ast-stats-2 AssocItem 416 ( 4.8%) 4 104 -ast-stats-2 - Type 208 ( 2.4%) 2 -ast-stats-2 - Fn 208 ( 2.4%) 2 -ast-stats-2 GenericParam 480 ( 5.5%) 5 96 -ast-stats-2 Pat 728 ( 8.4%) 7 104 -ast-stats-2 - Struct 104 ( 1.2%) 1 -ast-stats-2 - Wild 104 ( 1.2%) 1 -ast-stats-2 - Ident 520 ( 6.0%) 5 -ast-stats-2 PathSegment 792 ( 9.1%) 33 24 -ast-stats-2 Expr 792 ( 9.1%) 9 88 -ast-stats-2 - Path 88 ( 1.0%) 1 -ast-stats-2 - Match 88 ( 1.0%) 1 -ast-stats-2 - Struct 88 ( 1.0%) 1 -ast-stats-2 - InlineAsm 88 ( 1.0%) 1 -ast-stats-2 - Lit 176 ( 2.0%) 2 -ast-stats-2 - Block 264 ( 3.0%) 3 -ast-stats-2 Ty 1_120 (12.9%) 14 80 -ast-stats-2 - Rptr 80 ( 0.9%) 1 -ast-stats-2 - Ptr 80 ( 0.9%) 1 -ast-stats-2 - ImplicitSelf 160 ( 1.8%) 2 -ast-stats-2 - Path 800 ( 9.2%) 10 -ast-stats-2 Item 2_024 (23.4%) 11 184 -ast-stats-2 - Trait 184 ( 2.1%) 1 -ast-stats-2 - Enum 184 ( 2.1%) 1 -ast-stats-2 - ExternCrate 184 ( 2.1%) 1 -ast-stats-2 - ForeignMod 184 ( 2.1%) 1 -ast-stats-2 - Impl 184 ( 2.1%) 1 -ast-stats-2 - Fn 368 ( 4.2%) 2 -ast-stats-2 - Use 736 ( 8.5%) 4 +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.5%) 4 72 +ast-stats-2 - Trait 288 ( 3.5%) 4 +ast-stats-2 Block 288 ( 3.5%) 6 48 +ast-stats-2 AssocItem 416 ( 5.1%) 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 - 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 - 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 - Rptr 64 ( 0.8%) 1 +ast-stats-2 - Ptr 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 (24.9%) 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 ---------------------------------------------------------------- -ast-stats-2 Total 8_664 +ast-stats-2 Total 8_120 ast-stats-2 hir-stats HIR STATS hir-stats Name Accumulated Size Count Item Size