diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 097a59d027bb2..f47acf07fe434 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -414,7 +414,7 @@ impl GenericParam { /// a function, enum, trait, etc. #[derive(Clone, Encodable, Decodable, Debug)] pub struct Generics { - pub params: Vec, + pub params: Box<[GenericParam]>, pub where_clause: WhereClause, pub span: Span, } @@ -423,7 +423,7 @@ impl Default for Generics { /// Creates an instance of `Generics`. fn default() -> Generics { Generics { - params: Vec::new(), + params: Box::new([]), where_clause: WhereClause { has_where_token: false, predicates: Vec::new(), @@ -559,7 +559,7 @@ pub enum MetaItemKind { #[derive(Clone, Encodable, Decodable, Debug)] pub struct Block { /// The statements in the block. - pub stmts: Vec, + pub stmts: Box<[Stmt]>, pub id: NodeId, /// Distinguishes between `unsafe { ... }` and `{ ... }`. pub rules: BlockCheckMode, @@ -2440,7 +2440,7 @@ pub struct ForeignMod { #[derive(Clone, Encodable, Decodable, Debug)] pub struct EnumDef { - pub variants: Vec, + pub variants: Box<[Variant]>, } /// Enum variant. #[derive(Clone, Encodable, Decodable, Debug)] @@ -2801,7 +2801,7 @@ pub struct Impl { /// The trait being implemented, if any. pub of_trait: Option, pub self_ty: P, - pub items: Vec>, + pub items: Box<[P]>, } #[derive(Clone, Encodable, Decodable, Debug)] @@ -3039,18 +3039,18 @@ mod size_asserts { static_assert_size!(AssocItem, 104); static_assert_size!(AssocItemKind, 32); static_assert_size!(Attribute, 32); - static_assert_size!(Block, 48); + static_assert_size!(Block, 40); static_assert_size!(Expr, 104); static_assert_size!(ExprKind, 72); - static_assert_size!(Fn, 192); + 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!(Generics, 72); - static_assert_size!(Impl, 200); - static_assert_size!(Item, 184); - static_assert_size!(ItemKind, 112); + static_assert_size!(Generics, 64); + static_assert_size!(Impl, 184); + static_assert_size!(Item, 176); + static_assert_size!(ItemKind, 104); static_assert_size!(Lit, 48); static_assert_size!(LitKind, 24); static_assert_size!(Local, 72); diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs index f687bfeced841..cd2e3b3abd25a 100644 --- a/compiler/rustc_ast/src/visit.rs +++ b/compiler/rustc_ast/src/visit.rs @@ -340,7 +340,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) { visitor.visit_generics(generics); walk_list!(visitor, visit_trait_ref, of_trait); visitor.visit_ty(self_ty); - walk_list!(visitor, visit_assoc_item, items, AssocCtxt::Impl); + walk_list!(visitor, visit_assoc_item, items.iter(), AssocCtxt::Impl); } ItemKind::Struct(ref struct_definition, ref generics) | ItemKind::Union(ref struct_definition, ref generics) => { @@ -369,7 +369,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) { } pub fn walk_enum_def<'a, V: Visitor<'a>>(visitor: &mut V, enum_definition: &'a EnumDef) { - walk_list!(visitor, visit_variant, &enum_definition.variants); + walk_list!(visitor, visit_variant, enum_definition.variants.iter()); } pub fn walk_variant<'a, V: Visitor<'a>>(visitor: &mut V, variant: &'a Variant) @@ -608,7 +608,7 @@ pub fn walk_generic_param<'a, V: Visitor<'a>>(visitor: &mut V, param: &'a Generi } pub fn walk_generics<'a, V: Visitor<'a>>(visitor: &mut V, generics: &'a Generics) { - walk_list!(visitor, visit_generic_param, &generics.params); + walk_list!(visitor, visit_generic_param, generics.params.iter()); walk_list!(visitor, visit_where_predicate, &generics.where_clause.predicates); } @@ -714,7 +714,7 @@ pub fn walk_field_def<'a, V: Visitor<'a>>(visitor: &mut V, field: &'a FieldDef) } pub fn walk_block<'a, V: Visitor<'a>>(visitor: &mut V, block: &'a Block) { - walk_list!(visitor, visit_stmt, &block.stmts); + walk_list!(visitor, visit_stmt, block.stmts.iter()); } pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) { diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 23464bf0a5a28..4c63461e62fd5 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -1052,7 +1052,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { this.visit_trait_ref(t); this.visit_ty(self_ty); - walk_list!(this, visit_assoc_item, items, AssocCtxt::Impl); + walk_list!(this, visit_assoc_item, items.iter(), AssocCtxt::Impl); }); return; // Avoid visiting again. } @@ -1145,7 +1145,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { return; // Avoid visiting again. } ItemKind::Enum(ref def, _) => { - for variant in &def.variants { + for variant in def.variants.iter() { self.invalid_visibility(&variant.vis, None); for field in variant.data.fields() { self.invalid_visibility(&field.vis, None); @@ -1330,7 +1330,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { fn visit_generics(&mut self, generics: &'a Generics) { let mut prev_param_default = None; - for param in &generics.params { + for param in generics.params.iter() { match param.kind { GenericParamKind::Lifetime => (), GenericParamKind::Type { default: Some(_), .. } @@ -1357,7 +1357,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { deny_equality_constraints(self, predicate, generics); } } - walk_list!(self, visit_generic_param, &generics.params); + walk_list!(self, visit_generic_param, generics.params.iter()); for predicate in &generics.where_clause.predicates { match predicate { WherePredicate::BoundPredicate(bound_pred) => { @@ -1658,7 +1658,7 @@ fn deny_equality_constraints( if let TyKind::Path(None, path) = &qself.ty.kind { match &path.segments[..] { [PathSegment { ident, args: None, .. }] => { - for param in &generics.params { + for param in generics.params.iter() { if param.ident == *ident { let param = ident; match &full_path.segments[qself.position..] { @@ -1722,7 +1722,7 @@ fn deny_equality_constraints( // Given `A: Foo, A::Bar = RhsTy`, suggest `A: Foo`. if let TyKind::Path(None, full_path) = &predicate.lhs_ty.kind { if let [potential_param, potential_assoc] = &full_path.segments[..] { - for param in &generics.params { + for param in generics.params.iter() { if param.ident == potential_param.ident { for bound in ¶m.bounds { if let ast::GenericBound::Trait(trait_ref, TraitBoundModifier::None) = bound diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index ca5b7a6415515..50389f7c82ec4 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -477,7 +477,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } ast::ItemKind::Enum(ast::EnumDef { ref variants, .. }, ..) => { - for variant in variants { + for variant in variants.iter() { match (&variant.data, &variant.disr_expr) { (ast::VariantData::Unit(..), _) => {} (_, Some(disr_expr)) => gate_feature_post!( diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 8749a13c5dde1..778d853cca838 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -1714,7 +1714,7 @@ impl<'a> State<'a> { self.ibox(INDENT_UNIT); self.print_formal_generic_params(generic_params); let generics = ast::Generics { - params: Vec::new(), + params: Box::new([]), where_clause: ast::WhereClause { has_where_token: false, predicates: Vec::new(), diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs index 54bac29a6cee0..aba023cabddfe 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs @@ -294,7 +294,7 @@ impl<'a> State<'a> { self.space(); self.bopen(); self.print_inner_attributes(&item.attrs); - for impl_item in items { + for impl_item in items.iter() { self.print_assoc_item(impl_item); } let empty = item.attrs.is_empty() && items.is_empty(); diff --git a/compiler/rustc_builtin_macros/src/deriving/clone.rs b/compiler/rustc_builtin_macros/src/deriving/clone.rs index c7f2d95e72f0c..c0a19433fec2b 100644 --- a/compiler/rustc_builtin_macros/src/deriving/clone.rs +++ b/compiler/rustc_builtin_macros/src/deriving/clone.rs @@ -137,7 +137,7 @@ fn cs_clone_simple( process_variant(vdata); } StaticEnum(enum_def, ..) => { - for variant in &enum_def.variants { + for variant in enum_def.variants.iter() { process_variant(&variant.data); } } diff --git a/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs b/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs index 5b556c5c9b9d1..d877cc7d4e100 100644 --- a/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs +++ b/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs @@ -80,7 +80,7 @@ fn cs_total_eq_assert( process_variant(vdata); } StaticEnum(enum_def, ..) => { - for variant in &enum_def.variants { + for variant in enum_def.variants.iter() { process_variant(&variant.data); } } diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs index adffebd3fd285..f30d0d88e1066 100644 --- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs @@ -575,7 +575,7 @@ impl<'a> TraitDef<'a> { }) }); - let Generics { mut params, mut where_clause, .. } = + let (mut params, mut where_clause) = self.generics.to_generics(cx, self.span, type_ident, generics); where_clause.span = generics.where_clause.span; let ctxt = self.span.ctxt(); @@ -687,7 +687,7 @@ impl<'a> TraitDef<'a> { } } - let trait_generics = Generics { params, where_clause, span }; + let trait_generics = Generics { params: params.into_boxed_slice(), where_clause, span }; // Create the reference to the trait. let trait_ref = cx.trait_ref(trait_path); @@ -799,7 +799,7 @@ impl<'a> TraitDef<'a> { ) -> P { let mut field_tys = Vec::new(); - for variant in &enum_def.variants { + for variant in enum_def.variants.iter() { field_tys.extend(variant.data.fields().iter().map(|field| field.ty.clone())); } @@ -932,7 +932,7 @@ impl<'a> MethodDef<'a> { ) -> P { let span = trait_.span; // Create the generics that aren't for `Self`. - let fn_generics = self.generics.to_generics(cx, span, type_ident, generics); + let (params, where_clause) = self.generics.to_generics(cx, span, type_ident, generics); let args = { let self_arg = explicit_self.map(|explicit_self| { @@ -969,7 +969,7 @@ impl<'a> MethodDef<'a> { kind: ast::AssocItemKind::Fn(Box::new(ast::Fn { defaultness, sig, - generics: fn_generics, + generics: Generics { params: params.into_boxed_slice(), where_clause, span }, body: Some(body_block), })), tokens: None, diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/ty.rs b/compiler/rustc_builtin_macros/src/deriving/generic/ty.rs index 36e2e29308694..d3c4a6ca7bcb2 100644 --- a/compiler/rustc_builtin_macros/src/deriving/generic/ty.rs +++ b/compiler/rustc_builtin_macros/src/deriving/generic/ty.rs @@ -4,7 +4,7 @@ pub use Ty::*; use rustc_ast::ptr::P; -use rustc_ast::{self as ast, Expr, GenericArg, GenericParamKind, Generics, SelfKind}; +use rustc_ast::{self as ast, Expr, GenericArg, GenericParam, GenericParamKind, Generics, SelfKind, WhereClause}; use rustc_expand::base::ExtCtxt; use rustc_span::source_map::{respan, DUMMY_SP}; use rustc_span::symbol::{kw, Ident, Symbol}; @@ -176,7 +176,7 @@ impl Bounds { span: Span, self_ty: Ident, self_generics: &Generics, - ) -> Generics { + ) -> (Vec, WhereClause) { let params = self .bounds .iter() @@ -186,11 +186,9 @@ impl Bounds { }) .collect(); - Generics { - params, - where_clause: ast::WhereClause { has_where_token: false, predicates: Vec::new(), span }, - span, - } + let where_clause = + ast::WhereClause { has_where_token: false, predicates: Vec::new(), span }; + (params, where_clause) } } diff --git a/compiler/rustc_builtin_macros/src/deriving/mod.rs b/compiler/rustc_builtin_macros/src/deriving/mod.rs index a65d0bad6de80..b878bdabc5103 100644 --- a/compiler/rustc_builtin_macros/src/deriving/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/mod.rs @@ -97,7 +97,7 @@ fn call_unreachable(cx: &ExtCtxt<'_>, span: Span) -> P { let call = cx.expr_call_global(span, path, vec![]); cx.expr_block(P(ast::Block { - stmts: vec![cx.stmt_expr(call)], + stmts: vec![cx.stmt_expr(call)].into_boxed_slice(), id: ast::DUMMY_NODE_ID, rules: ast::BlockCheckMode::Unsafe(ast::CompilerGenerated), span, @@ -187,7 +187,7 @@ fn inject_impl_of_structural_trait( generics, of_trait: Some(trait_ref), self_ty: self_type, - items: Vec::new(), + items: Box::new([]), })), ); diff --git a/compiler/rustc_builtin_macros/src/format.rs b/compiler/rustc_builtin_macros/src/format.rs index 2100487107517..1a7add7965ea9 100644 --- a/compiler/rustc_builtin_macros/src/format.rs +++ b/compiler/rustc_builtin_macros/src/format.rs @@ -1090,7 +1090,7 @@ impl<'a, 'b> Context<'a, 'b> { let path = self.ecx.std_path(&[sym::fmt, sym::UnsafeArg, sym::new]); let unsafe_arg = self.ecx.expr_call_global(self.macsp, path, Vec::new()); let unsafe_expr = self.ecx.expr_block(P(ast::Block { - stmts: vec![self.ecx.stmt_expr(unsafe_arg)], + stmts: vec![self.ecx.stmt_expr(unsafe_arg)].into_boxed_slice(), id: ast::DUMMY_NODE_ID, rules: BlockCheckMode::Unsafe(UnsafeSource::CompilerGenerated), span: self.macsp, diff --git a/compiler/rustc_data_structures/src/map_in_place.rs b/compiler/rustc_data_structures/src/map_in_place.rs index a0d4b7ade1f33..c6b767cf21b1b 100644 --- a/compiler/rustc_data_structures/src/map_in_place.rs +++ b/compiler/rustc_data_structures/src/map_in_place.rs @@ -70,6 +70,19 @@ impl MapInPlace for Vec { flat_map_in_place!(); } +impl MapInPlace for Box<[T]> { + fn flat_map_in_place(&mut self, f: F) + where + F: FnMut(T) -> I, + I: IntoIterator, + { + let slice = std::mem::take(self); + let mut vec = slice.into_vec(); + vec.flat_map_in_place(f); + *self = vec.into_boxed_slice(); + } +} + impl> MapInPlace for SmallVec { flat_map_in_place!(); } diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs index c4890b4a9c413..50bc633448975 100644 --- a/compiler/rustc_expand/src/build.rs +++ b/compiler/rustc_expand/src/build.rs @@ -229,7 +229,7 @@ impl<'a> ExtCtxt<'a> { } pub fn block(&self, span: Span, stmts: Vec) -> P { P(ast::Block { - stmts, + stmts: stmts.into_boxed_slice(), id: ast::DUMMY_NODE_ID, rules: BlockCheckMode::Default, span, diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index 1f4e5b480917d..015c092aee004 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -797,7 +797,7 @@ impl EarlyLintPass for UnusedParens { None, None, ); - for stmt in &block.stmts { + for stmt in block.stmts.iter() { ::check_stmt(self, cx, stmt); } if let Some(e) = else_ { @@ -960,7 +960,7 @@ impl UnusedDelimLint for UnusedBraces { // (do not lint `struct A; let _: A<{ 2 + 3 }>;`) // // FIXME(const_generics): handle paths when #67075 is fixed. - if let [stmt] = inner.stmts.as_slice() { + if let [stmt] = &*inner.stmts { if let ast::StmtKind::Expr(ref expr) = stmt.kind { if !Self::is_expr_delims_necessary(expr, followed_by_block, false) && (ctx != UnusedDelimsCtx::AnonConst diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs index 4d0a8b05eb027..77039a6b95e69 100644 --- a/compiler/rustc_parse/src/parser/generics.rs +++ b/compiler/rustc_parse/src/parser/generics.rs @@ -198,7 +198,7 @@ impl<'a> Parser<'a> { (vec![], self.prev_token.span.shrink_to_hi()) }; Ok(ast::Generics { - params, + params: params.into_boxed_slice(), where_clause: WhereClause { has_where_token: false, predicates: Vec::new(), diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 5b75d1d5f221d..4e39e375a437c 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -637,7 +637,7 @@ impl<'a> Parser<'a> { generics, of_trait: Some(trait_ref), self_ty: ty_second, - items: impl_items, + items: impl_items.into_boxed_slice(), })) } None => { @@ -650,7 +650,7 @@ impl<'a> Parser<'a> { generics, of_trait: None, self_ty: ty_first, - items: impl_items, + items: impl_items.into_boxed_slice(), })) } }; diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 3d957406b19d8..191ab8e87fc50 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -645,7 +645,7 @@ impl<'a> Parser<'a> { pub(super) fn mk_block(&self, stmts: Vec, rules: BlockCheckMode, span: Span) -> P { P(Block { - stmts, + stmts: stmts.into_boxed_slice(), id: DUMMY_NODE_ID, rules, span, diff --git a/compiler/rustc_resolve/src/access_levels.rs b/compiler/rustc_resolve/src/access_levels.rs index 0a3add2e0f532..c4492eb090e98 100644 --- a/compiler/rustc_resolve/src/access_levels.rs +++ b/compiler/rustc_resolve/src/access_levels.rs @@ -149,7 +149,7 @@ impl<'r, 'ast> Visitor<'ast> for AccessLevelsVisitor<'ast, 'r> { ast::ItemKind::Enum(EnumDef { ref variants }, _) => { self.set_bindings_access_level(def_id); - for variant in variants { + for variant in variants.iter() { let variant_def_id = self.r.local_def_id(variant.id); let variant_level = self.r.access_levels.map.get(&variant_def_id).copied(); for field in variant.data.fields() { diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index dbe4d691f04cd..ecd89f3e3ecbc 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -3662,7 +3662,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { Some(block.span); } // Descend into the block. - for stmt in &block.stmts { + for stmt in block.stmts.iter() { if let StmtKind::Item(ref item) = stmt.kind && let ItemKind::MacroDef(..) = item.kind { num_macro_definition_ribs += 1; diff --git a/src/test/ui/stats/hir-stats.stderr b/src/test/ui/stats/hir-stats.stderr index 0a736f7be834e..790e9570d8924 100644 --- a/src/test/ui/stats/hir-stats.stderr +++ b/src/test/ui/stats/hir-stats.stderr @@ -11,49 +11,49 @@ 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.1%) 2 48 -ast-stats-1 ForeignItem 96 ( 1.1%) 1 96 -ast-stats-1 - Fn 96 ( 1.1%) 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 ( 1.9%) 2 80 ast-stats-1 Stmt 160 ( 1.9%) 5 32 ast-stats-1 - Local 32 ( 0.4%) 1 ast-stats-1 - MacCall 32 ( 0.4%) 1 -ast-stats-1 - Expr 96 ( 1.1%) 3 +ast-stats-1 - Expr 96 ( 1.2%) 3 ast-stats-1 Param 160 ( 1.9%) 4 40 ast-stats-1 FnDecl 200 ( 2.4%) 5 40 -ast-stats-1 Variant 240 ( 2.8%) 2 120 -ast-stats-1 Block 288 ( 3.4%) 6 48 +ast-stats-1 Variant 240 ( 2.9%) 2 120 +ast-stats-1 Block 240 ( 2.9%) 6 40 ast-stats-1 GenericBound 352 ( 4.2%) 4 88 ast-stats-1 - Trait 352 ( 4.2%) 4 -ast-stats-1 AssocItem 416 ( 4.9%) 4 104 +ast-stats-1 AssocItem 416 ( 5.0%) 4 104 ast-stats-1 - TyAlias 208 ( 2.5%) 2 ast-stats-1 - Fn 208 ( 2.5%) 2 -ast-stats-1 GenericParam 520 ( 6.1%) 5 104 -ast-stats-1 PathSegment 720 ( 8.5%) 30 24 -ast-stats-1 Expr 832 ( 9.8%) 8 104 +ast-stats-1 GenericParam 520 ( 6.2%) 5 104 +ast-stats-1 PathSegment 720 ( 8.6%) 30 24 +ast-stats-1 Expr 832 (10.0%) 8 104 ast-stats-1 - Path 104 ( 1.2%) 1 ast-stats-1 - Match 104 ( 1.2%) 1 ast-stats-1 - Struct 104 ( 1.2%) 1 ast-stats-1 - Lit 208 ( 2.5%) 2 ast-stats-1 - Block 312 ( 3.7%) 3 -ast-stats-1 Pat 840 ( 9.9%) 7 120 +ast-stats-1 Pat 840 (10.1%) 7 120 ast-stats-1 - Struct 120 ( 1.4%) 1 ast-stats-1 - Wild 120 ( 1.4%) 1 -ast-stats-1 - Ident 600 ( 7.1%) 5 -ast-stats-1 Ty 1_344 (15.9%) 14 96 -ast-stats-1 - Rptr 96 ( 1.1%) 1 -ast-stats-1 - Ptr 96 ( 1.1%) 1 +ast-stats-1 - Ident 600 ( 7.2%) 5 +ast-stats-1 Ty 1_344 (16.1%) 14 96 +ast-stats-1 - Rptr 96 ( 1.2%) 1 +ast-stats-1 - Ptr 96 ( 1.2%) 1 ast-stats-1 - ImplicitSelf 192 ( 2.3%) 2 -ast-stats-1 - Path 960 (11.4%) 10 -ast-stats-1 Item 1_656 (19.6%) 9 184 -ast-stats-1 - Trait 184 ( 2.2%) 1 -ast-stats-1 - Enum 184 ( 2.2%) 1 -ast-stats-1 - ForeignMod 184 ( 2.2%) 1 -ast-stats-1 - Impl 184 ( 2.2%) 1 -ast-stats-1 - Fn 368 ( 4.4%) 2 -ast-stats-1 - Use 552 ( 6.5%) 3 +ast-stats-1 - Path 960 (11.5%) 10 +ast-stats-1 Item 1_584 (19.0%) 9 176 +ast-stats-1 - Trait 176 ( 2.1%) 1 +ast-stats-1 - Enum 176 ( 2.1%) 1 +ast-stats-1 - ForeignMod 176 ( 2.1%) 1 +ast-stats-1 - Impl 176 ( 2.1%) 1 +ast-stats-1 - Fn 352 ( 4.2%) 2 +ast-stats-1 - Use 528 ( 6.3%) 3 ast-stats-1 ---------------------------------------------------------------- -ast-stats-1 Total 8_456 +ast-stats-1 Total 8_336 ast-stats-1 ast-stats-2 POST EXPANSION AST STATS ast-stats-2 Name Accumulated Size Count Item Size @@ -65,55 +65,55 @@ 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.0%) 2 48 -ast-stats-2 ForeignItem 96 ( 1.0%) 1 96 -ast-stats-2 - Fn 96 ( 1.0%) 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.3%) 1 120 ast-stats-2 Attribute 128 ( 1.4%) 4 32 -ast-stats-2 - DocComment 32 ( 0.3%) 1 -ast-stats-2 - Normal 96 ( 1.0%) 3 -ast-stats-2 FieldDef 160 ( 1.7%) 2 80 -ast-stats-2 Stmt 160 ( 1.7%) 5 32 -ast-stats-2 - Local 32 ( 0.3%) 1 -ast-stats-2 - Semi 32 ( 0.3%) 1 -ast-stats-2 - Expr 96 ( 1.0%) 3 -ast-stats-2 Param 160 ( 1.7%) 4 40 +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 - 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.2%) 5 40 -ast-stats-2 Variant 240 ( 2.6%) 2 120 -ast-stats-2 Block 288 ( 3.1%) 6 48 -ast-stats-2 GenericBound 352 ( 3.8%) 4 88 -ast-stats-2 - Trait 352 ( 3.8%) 4 -ast-stats-2 AssocItem 416 ( 4.5%) 4 104 +ast-stats-2 Variant 240 ( 2.7%) 2 120 +ast-stats-2 Block 240 ( 2.7%) 6 40 +ast-stats-2 GenericBound 352 ( 3.9%) 4 88 +ast-stats-2 - Trait 352 ( 3.9%) 4 +ast-stats-2 AssocItem 416 ( 4.6%) 4 104 ast-stats-2 - TyAlias 208 ( 2.3%) 2 ast-stats-2 - Fn 208 ( 2.3%) 2 ast-stats-2 GenericParam 520 ( 5.7%) 5 104 -ast-stats-2 PathSegment 792 ( 8.6%) 33 24 -ast-stats-2 Pat 840 ( 9.1%) 7 120 +ast-stats-2 PathSegment 792 ( 8.8%) 33 24 +ast-stats-2 Pat 840 ( 9.3%) 7 120 ast-stats-2 - Struct 120 ( 1.3%) 1 ast-stats-2 - Wild 120 ( 1.3%) 1 -ast-stats-2 - Ident 600 ( 6.5%) 5 -ast-stats-2 Expr 936 (10.2%) 9 104 +ast-stats-2 - Ident 600 ( 6.6%) 5 +ast-stats-2 Expr 936 (10.3%) 9 104 ast-stats-2 - Path 104 ( 1.1%) 1 ast-stats-2 - Match 104 ( 1.1%) 1 ast-stats-2 - Struct 104 ( 1.1%) 1 ast-stats-2 - InlineAsm 104 ( 1.1%) 1 ast-stats-2 - Lit 208 ( 2.3%) 2 ast-stats-2 - Block 312 ( 3.4%) 3 -ast-stats-2 Ty 1_344 (14.6%) 14 96 -ast-stats-2 - Rptr 96 ( 1.0%) 1 -ast-stats-2 - Ptr 96 ( 1.0%) 1 +ast-stats-2 Ty 1_344 (14.9%) 14 96 +ast-stats-2 - Rptr 96 ( 1.1%) 1 +ast-stats-2 - Ptr 96 ( 1.1%) 1 ast-stats-2 - ImplicitSelf 192 ( 2.1%) 2 -ast-stats-2 - Path 960 (10.5%) 10 -ast-stats-2 Item 2_024 (22.0%) 11 184 -ast-stats-2 - Trait 184 ( 2.0%) 1 -ast-stats-2 - Enum 184 ( 2.0%) 1 -ast-stats-2 - ExternCrate 184 ( 2.0%) 1 -ast-stats-2 - ForeignMod 184 ( 2.0%) 1 -ast-stats-2 - Impl 184 ( 2.0%) 1 -ast-stats-2 - Fn 368 ( 4.0%) 2 -ast-stats-2 - Use 736 ( 8.0%) 4 +ast-stats-2 - Path 960 (10.6%) 10 +ast-stats-2 Item 1_936 (21.4%) 11 176 +ast-stats-2 - Trait 176 ( 1.9%) 1 +ast-stats-2 - Enum 176 ( 1.9%) 1 +ast-stats-2 - ExternCrate 176 ( 1.9%) 1 +ast-stats-2 - ForeignMod 176 ( 1.9%) 1 +ast-stats-2 - Impl 176 ( 1.9%) 1 +ast-stats-2 - Fn 352 ( 3.9%) 2 +ast-stats-2 - Use 704 ( 7.8%) 4 ast-stats-2 ---------------------------------------------------------------- -ast-stats-2 Total 9_184 +ast-stats-2 Total 9_048 ast-stats-2 hir-stats HIR STATS hir-stats Name Accumulated Size Count Item Size