about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_metadata/src/creader.rs18
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs5
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs6
-rw-r--r--compiler/rustc_next_trait_solver/src/delegate.rs4
-rw-r--r--compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs11
-rw-r--r--compiler/rustc_passes/src/input_stats.rs10
-rw-r--r--compiler/rustc_trait_selection/src/solve/delegate.rs58
-rw-r--r--compiler/rustc_trait_selection/src/solve/fulfill.rs9
-rw-r--r--tests/ui/stats/input-stats.rs4
-rw-r--r--tests/ui/stats/input-stats.stderr322
10 files changed, 240 insertions, 207 deletions
diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs
index 802d75241de..de19c10bc57 100644
--- a/compiler/rustc_metadata/src/creader.rs
+++ b/compiler/rustc_metadata/src/creader.rs
@@ -21,6 +21,7 @@ use rustc_hir::def_id::{CrateNum, LOCAL_CRATE, LocalDefId, StableCrateId};
 use rustc_hir::definitions::Definitions;
 use rustc_index::IndexVec;
 use rustc_middle::bug;
+use rustc_middle::ty::data_structures::IndexSet;
 use rustc_middle::ty::{TyCtxt, TyCtxtFeed};
 use rustc_proc_macro::bridge::client::ProcMacro;
 use rustc_session::config::{
@@ -281,7 +282,7 @@ impl CStore {
             .filter_map(|(cnum, data)| data.as_deref_mut().map(|data| (cnum, data)))
     }
 
-    fn push_dependencies_in_postorder(&self, deps: &mut Vec<CrateNum>, cnum: CrateNum) {
+    fn push_dependencies_in_postorder(&self, deps: &mut IndexSet<CrateNum>, cnum: CrateNum) {
         if !deps.contains(&cnum) {
             let data = self.get_crate_data(cnum);
             for dep in data.dependencies() {
@@ -290,12 +291,12 @@ impl CStore {
                 }
             }
 
-            deps.push(cnum);
+            deps.insert(cnum);
         }
     }
 
-    pub(crate) fn crate_dependencies_in_postorder(&self, cnum: CrateNum) -> Vec<CrateNum> {
-        let mut deps = Vec::new();
+    pub(crate) fn crate_dependencies_in_postorder(&self, cnum: CrateNum) -> IndexSet<CrateNum> {
+        let mut deps = IndexSet::default();
         if cnum == LOCAL_CRATE {
             for (cnum, _) in self.iter_crate_data() {
                 self.push_dependencies_in_postorder(&mut deps, cnum);
@@ -306,10 +307,11 @@ impl CStore {
         deps
     }
 
-    fn crate_dependencies_in_reverse_postorder(&self, cnum: CrateNum) -> Vec<CrateNum> {
-        let mut deps = self.crate_dependencies_in_postorder(cnum);
-        deps.reverse();
-        deps
+    fn crate_dependencies_in_reverse_postorder(
+        &self,
+        cnum: CrateNum,
+    ) -> impl Iterator<Item = CrateNum> {
+        self.crate_dependencies_in_postorder(cnum).into_iter().rev()
     }
 
     pub(crate) fn injected_panic_runtime(&self) -> Option<CrateNum> {
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
index f40a2374bea..375928c2245 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
@@ -549,8 +549,9 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
         has_global_allocator: |tcx, LocalCrate| CStore::from_tcx(tcx).has_global_allocator(),
         has_alloc_error_handler: |tcx, LocalCrate| CStore::from_tcx(tcx).has_alloc_error_handler(),
         postorder_cnums: |tcx, ()| {
-            tcx.arena
-                .alloc_slice(&CStore::from_tcx(tcx).crate_dependencies_in_postorder(LOCAL_CRATE))
+            tcx.arena.alloc_from_iter(
+                CStore::from_tcx(tcx).crate_dependencies_in_postorder(LOCAL_CRATE).into_iter(),
+            )
         },
         crates: |tcx, ()| {
             // The list of loaded crates is now frozen in query cache,
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index 77b9becba57..404674c359e 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -1882,10 +1882,8 @@ impl<'tcx> Ty<'tcx> {
             // Needs normalization or revealing to determine, so no is the safe answer.
             ty::Alias(..) => false,
 
-            ty::Param(..) | ty::Placeholder(..) | ty::Infer(..) | ty::Error(..) => false,
-
-            ty::Bound(..) => {
-                bug!("`is_trivially_pure_clone_copy` applied to unexpected type: {:?}", self);
+            ty::Param(..) | ty::Placeholder(..) | ty::Bound(..) | ty::Infer(..) | ty::Error(..) => {
+                false
             }
         }
     }
diff --git a/compiler/rustc_next_trait_solver/src/delegate.rs b/compiler/rustc_next_trait_solver/src/delegate.rs
index 32dc85b3e6a..7b932010d49 100644
--- a/compiler/rustc_next_trait_solver/src/delegate.rs
+++ b/compiler/rustc_next_trait_solver/src/delegate.rs
@@ -3,8 +3,6 @@ use std::ops::Deref;
 use rustc_type_ir::solve::{Certainty, Goal, NoSolution};
 use rustc_type_ir::{self as ty, InferCtxtLike, Interner, TypeFoldable};
 
-use crate::solve::HasChanged;
-
 pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
     type Infcx: InferCtxtLike<Interner = Self::Interner>;
     type Interner: Interner;
@@ -23,7 +21,7 @@ pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
         &self,
         goal: Goal<Self::Interner, <Self::Interner as Interner>::Predicate>,
         span: <Self::Interner as Interner>::Span,
-    ) -> Option<HasChanged>;
+    ) -> Option<Certainty>;
 
     fn fresh_var_for_kind_with_span(
         &self,
diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
index b1a842e04af..38d7ff576a5 100644
--- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
+++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
@@ -671,10 +671,13 @@ where
         // If this loop did not result in any progress, what's our final certainty.
         let mut unchanged_certainty = Some(Certainty::Yes);
         for (source, goal, stalled_on) in mem::take(&mut self.nested_goals) {
-            if let Some(has_changed) = self.delegate.compute_goal_fast_path(goal, self.origin_span)
-            {
-                if matches!(has_changed, HasChanged::Yes) {
-                    unchanged_certainty = None;
+            if let Some(certainty) = self.delegate.compute_goal_fast_path(goal, self.origin_span) {
+                match certainty {
+                    Certainty::Yes => {}
+                    Certainty::Maybe(_) => {
+                        self.nested_goals.push((source, goal, None));
+                        unchanged_certainty = unchanged_certainty.map(|c| c.and(certainty));
+                    }
                 }
                 continue;
             }
diff --git a/compiler/rustc_passes/src/input_stats.rs b/compiler/rustc_passes/src/input_stats.rs
index 71815448172..6852153a2e7 100644
--- a/compiler/rustc_passes/src/input_stats.rs
+++ b/compiler/rustc_passes/src/input_stats.rs
@@ -426,10 +426,16 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
         hir_visit::walk_fn(self, fk, fd, b, id)
     }
 
-    fn visit_use(&mut self, p: &'v hir::UsePath<'v>, hir_id: HirId) {
+    fn visit_use(&mut self, p: &'v hir::UsePath<'v>, _hir_id: HirId) {
         // This is `visit_use`, but the type is `Path` so record it that way.
         self.record("Path", None, p);
-        hir_visit::walk_use(self, p, hir_id)
+        // Don't call `hir_visit::walk_use(self, p, hir_id)`: it calls
+        // `visit_path` up to three times, once for each namespace result in
+        // `p.res`, by building temporary `Path`s that are not part of the real
+        // HIR, which causes `p` to be double- or triple-counted. Instead just
+        // walk the path internals (i.e. the segments) directly.
+        let hir::Path { span: _, res: _, segments } = *p;
+        ast_visit::walk_list!(self, visit_path_segment, segments);
     }
 
     fn visit_trait_item(&mut self, ti: &'v hir::TraitItem<'v>) {
diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs
index 038cdc1a564..e92e37b8738 100644
--- a/compiler/rustc_trait_selection/src/solve/delegate.rs
+++ b/compiler/rustc_trait_selection/src/solve/delegate.rs
@@ -11,8 +11,9 @@ use rustc_infer::infer::{InferCtxt, RegionVariableOrigin, SubregionOrigin, TyCtx
 use rustc_infer::traits::solve::Goal;
 use rustc_middle::traits::query::NoSolution;
 use rustc_middle::traits::solve::Certainty;
-use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeVisitableExt as _, TypingMode};
-use rustc_next_trait_solver::solve::HasChanged;
+use rustc_middle::ty::{
+    self, Ty, TyCtxt, TypeFlags, TypeFoldable, TypeVisitableExt as _, TypingMode,
+};
 use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
 
 use crate::traits::{EvaluateConstErr, ObligationCause, specialization_graph};
@@ -61,11 +62,41 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
         &self,
         goal: Goal<'tcx, ty::Predicate<'tcx>>,
         span: Span,
-    ) -> Option<HasChanged> {
+    ) -> Option<Certainty> {
+        if let Some(trait_pred) = goal.predicate.as_trait_clause() {
+            if trait_pred.polarity() == ty::PredicatePolarity::Positive {
+                match self.0.tcx.as_lang_item(trait_pred.def_id()) {
+                    Some(LangItem::Sized)
+                        if self
+                            .resolve_vars_if_possible(trait_pred.self_ty().skip_binder())
+                            .is_trivially_sized(self.0.tcx) =>
+                    {
+                        return Some(Certainty::Yes);
+                    }
+                    Some(LangItem::Copy | LangItem::Clone) => {
+                        let self_ty =
+                            self.resolve_vars_if_possible(trait_pred.self_ty().skip_binder());
+                        // Unlike `Sized` traits, which always prefer the built-in impl,
+                        // `Copy`/`Clone` may be shadowed by a param-env candidate which
+                        // could force a lifetime error or guide inference. While that's
+                        // not generally desirable, it is observable, so for now let's
+                        // ignore this fast path for types that have regions or infer.
+                        if !self_ty
+                            .has_type_flags(TypeFlags::HAS_FREE_REGIONS | TypeFlags::HAS_INFER)
+                            && self_ty.is_trivially_pure_clone_copy()
+                        {
+                            return Some(Certainty::Yes);
+                        }
+                    }
+                    _ => {}
+                }
+            }
+        }
+
         let pred = goal.predicate.kind();
         match pred.no_bound_vars()? {
             ty::PredicateKind::DynCompatible(def_id) if self.0.tcx.is_dyn_compatible(def_id) => {
-                Some(HasChanged::No)
+                Some(Certainty::Yes)
             }
             ty::PredicateKind::Clause(ty::ClauseKind::RegionOutlives(outlives)) => {
                 self.0.sub_regions(
@@ -73,7 +104,7 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
                     outlives.1,
                     outlives.0,
                 );
-                Some(HasChanged::No)
+                Some(Certainty::Yes)
             }
             ty::PredicateKind::Clause(ty::ClauseKind::TypeOutlives(outlives)) => {
                 self.0.register_type_outlives_constraint(
@@ -82,22 +113,7 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
                     &ObligationCause::dummy_with_span(span),
                 );
 
-                Some(HasChanged::No)
-            }
-            ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_pred)) => {
-                match self.0.tcx.as_lang_item(trait_pred.def_id()) {
-                    Some(LangItem::Sized)
-                        if trait_pred.self_ty().is_trivially_sized(self.0.tcx) =>
-                    {
-                        Some(HasChanged::No)
-                    }
-                    Some(LangItem::Copy | LangItem::Clone)
-                        if trait_pred.self_ty().is_trivially_pure_clone_copy() =>
-                    {
-                        Some(HasChanged::No)
-                    }
-                    _ => None,
-                }
+                Some(Certainty::Yes)
             }
             _ => None,
         }
diff --git a/compiler/rustc_trait_selection/src/solve/fulfill.rs b/compiler/rustc_trait_selection/src/solve/fulfill.rs
index d273703a9b1..ed99c678a4d 100644
--- a/compiler/rustc_trait_selection/src/solve/fulfill.rs
+++ b/compiler/rustc_trait_selection/src/solve/fulfill.rs
@@ -195,10 +195,15 @@ where
 
                 let goal = obligation.as_goal();
                 let delegate = <&SolverDelegate<'tcx>>::from(infcx);
-                if let Some(fast_path_has_changed) =
+                if let Some(certainty) =
                     delegate.compute_goal_fast_path(goal, obligation.cause.span)
                 {
-                    any_changed |= matches!(fast_path_has_changed, HasChanged::Yes);
+                    match certainty {
+                        Certainty::Yes => {}
+                        Certainty::Maybe(_) => {
+                            self.obligations.register(obligation, None);
+                        }
+                    }
                     continue;
                 }
 
diff --git a/tests/ui/stats/input-stats.rs b/tests/ui/stats/input-stats.rs
index f19a53cc610..e760e2894e3 100644
--- a/tests/ui/stats/input-stats.rs
+++ b/tests/ui/stats/input-stats.rs
@@ -3,6 +3,10 @@
 //@ only-64bit
 // layout randomization affects the hir stat output
 //@ needs-deterministic-layouts
+//
+// Filter out the percentages because a change to a single count can affect
+// many or all percentages, which makes the diffs hard to read.
+//@ normalize-stderr: "\([0-9 ][0-9]\.[0-9]%\)" -> "(NN.N%)"
 
 // Type layouts sometimes change. When that happens, until the next bootstrap
 // bump occurs, stage1 and stage2 will give different outputs for this test.
diff --git a/tests/ui/stats/input-stats.stderr b/tests/ui/stats/input-stats.stderr
index b369af62f87..58ab1a72556 100644
--- a/tests/ui/stats/input-stats.stderr
+++ b/tests/ui/stats/input-stats.stderr
@@ -1,178 +1,178 @@
 ast-stats-1 PRE EXPANSION AST STATS
 ast-stats-1 Name                Accumulated Size         Count     Item Size
 ast-stats-1 ----------------------------------------------------------------
-ast-stats-1 Crate                     40 ( 0.6%)             1            40
-ast-stats-1 GenericArgs               40 ( 0.6%)             1            40
-ast-stats-1 - AngleBracketed            40 ( 0.6%)             1
-ast-stats-1 ExprField                 48 ( 0.7%)             1            48
-ast-stats-1 Attribute                 64 ( 0.9%)             2            32
-ast-stats-1 - DocComment                32 ( 0.5%)             1
-ast-stats-1 - Normal                    32 ( 0.5%)             1
-ast-stats-1 WherePredicate            72 ( 1.1%)             1            72
-ast-stats-1 - BoundPredicate            72 ( 1.1%)             1
-ast-stats-1 ForeignItem               80 ( 1.2%)             1            80
-ast-stats-1 - Fn                        80 ( 1.2%)             1
-ast-stats-1 Arm                       96 ( 1.4%)             2            48
-ast-stats-1 Local                     96 ( 1.4%)             1            96
-ast-stats-1 FnDecl                   120 ( 1.8%)             5            24
-ast-stats-1 Param                    160 ( 2.4%)             4            40
-ast-stats-1 Stmt                     160 ( 2.4%)             5            32
-ast-stats-1 - Let                       32 ( 0.5%)             1
-ast-stats-1 - MacCall                   32 ( 0.5%)             1
-ast-stats-1 - Expr                      96 ( 1.4%)             3
-ast-stats-1 Block                    192 ( 2.8%)             6            32
-ast-stats-1 FieldDef                 208 ( 3.1%)             2           104
-ast-stats-1 Variant                  208 ( 3.1%)             2           104
-ast-stats-1 AssocItem                320 ( 4.7%)             4            80
-ast-stats-1 - Fn                       160 ( 2.4%)             2
-ast-stats-1 - Type                     160 ( 2.4%)             2
-ast-stats-1 GenericBound             352 ( 5.2%)             4            88
-ast-stats-1 - Trait                    352 ( 5.2%)             4
-ast-stats-1 GenericParam             480 ( 7.1%)             5            96
-ast-stats-1 Pat                      504 ( 7.5%)             7            72
-ast-stats-1 - Struct                    72 ( 1.1%)             1
-ast-stats-1 - Wild                      72 ( 1.1%)             1
-ast-stats-1 - Ident                    360 ( 5.3%)             5
-ast-stats-1 Expr                     576 ( 8.5%)             8            72
-ast-stats-1 - Match                     72 ( 1.1%)             1
-ast-stats-1 - Path                      72 ( 1.1%)             1
-ast-stats-1 - Struct                    72 ( 1.1%)             1
-ast-stats-1 - Lit                      144 ( 2.1%)             2
-ast-stats-1 - Block                    216 ( 3.2%)             3
-ast-stats-1 PathSegment              744 (11.0%)            31            24
-ast-stats-1 Ty                       896 (13.3%)            14            64
-ast-stats-1 - Ptr                       64 ( 0.9%)             1
-ast-stats-1 - Ref                       64 ( 0.9%)             1
-ast-stats-1 - ImplicitSelf             128 ( 1.9%)             2
-ast-stats-1 - Path                     640 ( 9.5%)            10
-ast-stats-1 Item                   1_296 (19.2%)             9           144
-ast-stats-1 - Enum                     144 ( 2.1%)             1
-ast-stats-1 - ForeignMod               144 ( 2.1%)             1
-ast-stats-1 - Impl                     144 ( 2.1%)             1
-ast-stats-1 - Trait                    144 ( 2.1%)             1
-ast-stats-1 - Fn                       288 ( 4.3%)             2
-ast-stats-1 - Use                      432 ( 6.4%)             3
+ast-stats-1 Crate                     40 (NN.N%)             1            40
+ast-stats-1 GenericArgs               40 (NN.N%)             1            40
+ast-stats-1 - AngleBracketed            40 (NN.N%)             1
+ast-stats-1 ExprField                 48 (NN.N%)             1            48
+ast-stats-1 Attribute                 64 (NN.N%)             2            32
+ast-stats-1 - DocComment                32 (NN.N%)             1
+ast-stats-1 - Normal                    32 (NN.N%)             1
+ast-stats-1 WherePredicate            72 (NN.N%)             1            72
+ast-stats-1 - BoundPredicate            72 (NN.N%)             1
+ast-stats-1 ForeignItem               80 (NN.N%)             1            80
+ast-stats-1 - Fn                        80 (NN.N%)             1
+ast-stats-1 Arm                       96 (NN.N%)             2            48
+ast-stats-1 Local                     96 (NN.N%)             1            96
+ast-stats-1 FnDecl                   120 (NN.N%)             5            24
+ast-stats-1 Param                    160 (NN.N%)             4            40
+ast-stats-1 Stmt                     160 (NN.N%)             5            32
+ast-stats-1 - Let                       32 (NN.N%)             1
+ast-stats-1 - MacCall                   32 (NN.N%)             1
+ast-stats-1 - Expr                      96 (NN.N%)             3
+ast-stats-1 Block                    192 (NN.N%)             6            32
+ast-stats-1 FieldDef                 208 (NN.N%)             2           104
+ast-stats-1 Variant                  208 (NN.N%)             2           104
+ast-stats-1 AssocItem                320 (NN.N%)             4            80
+ast-stats-1 - Fn                       160 (NN.N%)             2
+ast-stats-1 - Type                     160 (NN.N%)             2
+ast-stats-1 GenericBound             352 (NN.N%)             4            88
+ast-stats-1 - Trait                    352 (NN.N%)             4
+ast-stats-1 GenericParam             480 (NN.N%)             5            96
+ast-stats-1 Pat                      504 (NN.N%)             7            72
+ast-stats-1 - Struct                    72 (NN.N%)             1
+ast-stats-1 - Wild                      72 (NN.N%)             1
+ast-stats-1 - Ident                    360 (NN.N%)             5
+ast-stats-1 Expr                     576 (NN.N%)             8            72
+ast-stats-1 - Match                     72 (NN.N%)             1
+ast-stats-1 - Path                      72 (NN.N%)             1
+ast-stats-1 - Struct                    72 (NN.N%)             1
+ast-stats-1 - Lit                      144 (NN.N%)             2
+ast-stats-1 - Block                    216 (NN.N%)             3
+ast-stats-1 PathSegment              744 (NN.N%)            31            24
+ast-stats-1 Ty                       896 (NN.N%)            14            64
+ast-stats-1 - Ptr                       64 (NN.N%)             1
+ast-stats-1 - Ref                       64 (NN.N%)             1
+ast-stats-1 - ImplicitSelf             128 (NN.N%)             2
+ast-stats-1 - Path                     640 (NN.N%)            10
+ast-stats-1 Item                   1_296 (NN.N%)             9           144
+ast-stats-1 - Enum                     144 (NN.N%)             1
+ast-stats-1 - ForeignMod               144 (NN.N%)             1
+ast-stats-1 - Impl                     144 (NN.N%)             1
+ast-stats-1 - Trait                    144 (NN.N%)             1
+ast-stats-1 - Fn                       288 (NN.N%)             2
+ast-stats-1 - Use                      432 (NN.N%)             3
 ast-stats-1 ----------------------------------------------------------------
 ast-stats-1 Total                  6_752                   116
 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 Crate                     40 ( 0.5%)             1            40
-ast-stats-2 GenericArgs               40 ( 0.5%)             1            40
-ast-stats-2 - AngleBracketed            40 ( 0.5%)             1
-ast-stats-2 ExprField                 48 ( 0.6%)             1            48
-ast-stats-2 WherePredicate            72 ( 1.0%)             1            72
-ast-stats-2 - BoundPredicate            72 ( 1.0%)             1
-ast-stats-2 ForeignItem               80 ( 1.1%)             1            80
-ast-stats-2 - Fn                        80 ( 1.1%)             1
-ast-stats-2 Arm                       96 ( 1.3%)             2            48
-ast-stats-2 Local                     96 ( 1.3%)             1            96
-ast-stats-2 FnDecl                   120 ( 1.6%)             5            24
-ast-stats-2 InlineAsm                120 ( 1.6%)             1           120
-ast-stats-2 Attribute                128 ( 1.7%)             4            32
-ast-stats-2 - DocComment                32 ( 0.4%)             1
-ast-stats-2 - Normal                    96 ( 1.3%)             3
-ast-stats-2 Param                    160 ( 2.2%)             4            40
-ast-stats-2 Stmt                     160 ( 2.2%)             5            32
-ast-stats-2 - Let                       32 ( 0.4%)             1
-ast-stats-2 - Semi                      32 ( 0.4%)             1
-ast-stats-2 - Expr                      96 ( 1.3%)             3
-ast-stats-2 Block                    192 ( 2.6%)             6            32
-ast-stats-2 FieldDef                 208 ( 2.8%)             2           104
-ast-stats-2 Variant                  208 ( 2.8%)             2           104
-ast-stats-2 AssocItem                320 ( 4.3%)             4            80
-ast-stats-2 - Fn                       160 ( 2.2%)             2
-ast-stats-2 - Type                     160 ( 2.2%)             2
-ast-stats-2 GenericBound             352 ( 4.7%)             4            88
-ast-stats-2 - Trait                    352 ( 4.7%)             4
-ast-stats-2 GenericParam             480 ( 6.5%)             5            96
-ast-stats-2 Pat                      504 ( 6.8%)             7            72
-ast-stats-2 - Struct                    72 ( 1.0%)             1
-ast-stats-2 - Wild                      72 ( 1.0%)             1
-ast-stats-2 - Ident                    360 ( 4.9%)             5
-ast-stats-2 Expr                     648 ( 8.7%)             9            72
-ast-stats-2 - InlineAsm                 72 ( 1.0%)             1
-ast-stats-2 - Match                     72 ( 1.0%)             1
-ast-stats-2 - Path                      72 ( 1.0%)             1
-ast-stats-2 - Struct                    72 ( 1.0%)             1
-ast-stats-2 - Lit                      144 ( 1.9%)             2
-ast-stats-2 - Block                    216 ( 2.9%)             3
-ast-stats-2 PathSegment              864 (11.7%)            36            24
-ast-stats-2 Ty                       896 (12.1%)            14            64
-ast-stats-2 - Ptr                       64 ( 0.9%)             1
-ast-stats-2 - Ref                       64 ( 0.9%)             1
-ast-stats-2 - ImplicitSelf             128 ( 1.7%)             2
-ast-stats-2 - Path                     640 ( 8.6%)            10
-ast-stats-2 Item                   1_584 (21.4%)            11           144
-ast-stats-2 - Enum                     144 ( 1.9%)             1
-ast-stats-2 - ExternCrate              144 ( 1.9%)             1
-ast-stats-2 - ForeignMod               144 ( 1.9%)             1
-ast-stats-2 - Impl                     144 ( 1.9%)             1
-ast-stats-2 - Trait                    144 ( 1.9%)             1
-ast-stats-2 - Fn                       288 ( 3.9%)             2
-ast-stats-2 - Use                      576 ( 7.8%)             4
+ast-stats-2 Crate                     40 (NN.N%)             1            40
+ast-stats-2 GenericArgs               40 (NN.N%)             1            40
+ast-stats-2 - AngleBracketed            40 (NN.N%)             1
+ast-stats-2 ExprField                 48 (NN.N%)             1            48
+ast-stats-2 WherePredicate            72 (NN.N%)             1            72
+ast-stats-2 - BoundPredicate            72 (NN.N%)             1
+ast-stats-2 ForeignItem               80 (NN.N%)             1            80
+ast-stats-2 - Fn                        80 (NN.N%)             1
+ast-stats-2 Arm                       96 (NN.N%)             2            48
+ast-stats-2 Local                     96 (NN.N%)             1            96
+ast-stats-2 FnDecl                   120 (NN.N%)             5            24
+ast-stats-2 InlineAsm                120 (NN.N%)             1           120
+ast-stats-2 Attribute                128 (NN.N%)             4            32
+ast-stats-2 - DocComment                32 (NN.N%)             1
+ast-stats-2 - Normal                    96 (NN.N%)             3
+ast-stats-2 Param                    160 (NN.N%)             4            40
+ast-stats-2 Stmt                     160 (NN.N%)             5            32
+ast-stats-2 - Let                       32 (NN.N%)             1
+ast-stats-2 - Semi                      32 (NN.N%)             1
+ast-stats-2 - Expr                      96 (NN.N%)             3
+ast-stats-2 Block                    192 (NN.N%)             6            32
+ast-stats-2 FieldDef                 208 (NN.N%)             2           104
+ast-stats-2 Variant                  208 (NN.N%)             2           104
+ast-stats-2 AssocItem                320 (NN.N%)             4            80
+ast-stats-2 - Fn                       160 (NN.N%)             2
+ast-stats-2 - Type                     160 (NN.N%)             2
+ast-stats-2 GenericBound             352 (NN.N%)             4            88
+ast-stats-2 - Trait                    352 (NN.N%)             4
+ast-stats-2 GenericParam             480 (NN.N%)             5            96
+ast-stats-2 Pat                      504 (NN.N%)             7            72
+ast-stats-2 - Struct                    72 (NN.N%)             1
+ast-stats-2 - Wild                      72 (NN.N%)             1
+ast-stats-2 - Ident                    360 (NN.N%)             5
+ast-stats-2 Expr                     648 (NN.N%)             9            72
+ast-stats-2 - InlineAsm                 72 (NN.N%)             1
+ast-stats-2 - Match                     72 (NN.N%)             1
+ast-stats-2 - Path                      72 (NN.N%)             1
+ast-stats-2 - Struct                    72 (NN.N%)             1
+ast-stats-2 - Lit                      144 (NN.N%)             2
+ast-stats-2 - Block                    216 (NN.N%)             3
+ast-stats-2 PathSegment              864 (NN.N%)            36            24
+ast-stats-2 Ty                       896 (NN.N%)            14            64
+ast-stats-2 - Ptr                       64 (NN.N%)             1
+ast-stats-2 - Ref                       64 (NN.N%)             1
+ast-stats-2 - ImplicitSelf             128 (NN.N%)             2
+ast-stats-2 - Path                     640 (NN.N%)            10
+ast-stats-2 Item                   1_584 (NN.N%)            11           144
+ast-stats-2 - Enum                     144 (NN.N%)             1
+ast-stats-2 - ExternCrate              144 (NN.N%)             1
+ast-stats-2 - ForeignMod               144 (NN.N%)             1
+ast-stats-2 - Impl                     144 (NN.N%)             1
+ast-stats-2 - Trait                    144 (NN.N%)             1
+ast-stats-2 - Fn                       288 (NN.N%)             2
+ast-stats-2 - Use                      576 (NN.N%)             4
 ast-stats-2 ----------------------------------------------------------------
 ast-stats-2 Total                  7_416                   127
 ast-stats-2
 hir-stats HIR STATS
 hir-stats Name                Accumulated Size         Count     Item Size
 hir-stats ----------------------------------------------------------------
-hir-stats ForeignItemRef            24 ( 0.3%)             1            24
-hir-stats Lifetime                  28 ( 0.3%)             1            28
-hir-stats Mod                       32 ( 0.4%)             1            32
-hir-stats ExprField                 40 ( 0.4%)             1            40
-hir-stats TraitItemRef              56 ( 0.6%)             2            28
-hir-stats GenericArg                64 ( 0.7%)             4            16
-hir-stats - Type                      16 ( 0.2%)             1
-hir-stats - Lifetime                  48 ( 0.5%)             3
-hir-stats Param                     64 ( 0.7%)             2            32
-hir-stats Body                      72 ( 0.8%)             3            24
-hir-stats ImplItemRef               72 ( 0.8%)             2            36
-hir-stats InlineAsm                 72 ( 0.8%)             1            72
-hir-stats Local                     72 ( 0.8%)             1            72
-hir-stats WherePredicate            72 ( 0.8%)             3            24
-hir-stats - BoundPredicate            72 ( 0.8%)             3
-hir-stats Arm                       80 ( 0.9%)             2            40
-hir-stats Stmt                      96 ( 1.1%)             3            32
-hir-stats - Expr                      32 ( 0.4%)             1
-hir-stats - Let                       32 ( 0.4%)             1
-hir-stats - Semi                      32 ( 0.4%)             1
-hir-stats FnDecl                   120 ( 1.3%)             3            40
-hir-stats Attribute                128 ( 1.4%)             4            32
-hir-stats FieldDef                 128 ( 1.4%)             2            64
-hir-stats GenericArgs              144 ( 1.6%)             3            48
-hir-stats Variant                  144 ( 1.6%)             2            72
-hir-stats GenericBound             256 ( 2.8%)             4            64
-hir-stats - Trait                    256 ( 2.8%)             4
-hir-stats Block                    288 ( 3.2%)             6            48
-hir-stats Pat                      360 ( 4.0%)             5            72
-hir-stats - Struct                    72 ( 0.8%)             1
-hir-stats - Wild                      72 ( 0.8%)             1
-hir-stats - Binding                  216 ( 2.4%)             3
-hir-stats GenericParam             400 ( 4.5%)             5            80
-hir-stats Generics                 560 ( 6.2%)            10            56
-hir-stats Ty                       720 ( 8.0%)            15            48
-hir-stats - Ptr                       48 ( 0.5%)             1
-hir-stats - Ref                       48 ( 0.5%)             1
-hir-stats - Path                     624 ( 6.9%)            13
-hir-stats Expr                     768 ( 8.5%)            12            64
-hir-stats - InlineAsm                 64 ( 0.7%)             1
-hir-stats - Match                     64 ( 0.7%)             1
-hir-stats - Path                      64 ( 0.7%)             1
-hir-stats - Struct                    64 ( 0.7%)             1
-hir-stats - Lit                      128 ( 1.4%)             2
-hir-stats - Block                    384 ( 4.3%)             6
-hir-stats Item                     968 (10.8%)            11            88
-hir-stats - Enum                      88 ( 1.0%)             1
-hir-stats - ExternCrate               88 ( 1.0%)             1
-hir-stats - ForeignMod                88 ( 1.0%)             1
-hir-stats - Impl                      88 ( 1.0%)             1
-hir-stats - Trait                     88 ( 1.0%)             1
-hir-stats - Fn                       176 ( 2.0%)             2
-hir-stats - Use                      352 ( 3.9%)             4
-hir-stats Path                   1_240 (13.8%)            31            40
-hir-stats PathSegment            1_920 (21.4%)            40            48
+hir-stats ForeignItemRef            24 (NN.N%)             1            24
+hir-stats Lifetime                  28 (NN.N%)             1            28
+hir-stats Mod                       32 (NN.N%)             1            32
+hir-stats ExprField                 40 (NN.N%)             1            40
+hir-stats TraitItemRef              56 (NN.N%)             2            28
+hir-stats GenericArg                64 (NN.N%)             4            16
+hir-stats - Type                      16 (NN.N%)             1
+hir-stats - Lifetime                  48 (NN.N%)             3
+hir-stats Param                     64 (NN.N%)             2            32
+hir-stats Body                      72 (NN.N%)             3            24
+hir-stats ImplItemRef               72 (NN.N%)             2            36
+hir-stats InlineAsm                 72 (NN.N%)             1            72
+hir-stats Local                     72 (NN.N%)             1            72
+hir-stats WherePredicate            72 (NN.N%)             3            24
+hir-stats - BoundPredicate            72 (NN.N%)             3
+hir-stats Arm                       80 (NN.N%)             2            40
+hir-stats Stmt                      96 (NN.N%)             3            32
+hir-stats - Expr                      32 (NN.N%)             1
+hir-stats - Let                       32 (NN.N%)             1
+hir-stats - Semi                      32 (NN.N%)             1
+hir-stats FnDecl                   120 (NN.N%)             3            40
+hir-stats Attribute                128 (NN.N%)             4            32
+hir-stats FieldDef                 128 (NN.N%)             2            64
+hir-stats GenericArgs              144 (NN.N%)             3            48
+hir-stats Variant                  144 (NN.N%)             2            72
+hir-stats GenericBound             256 (NN.N%)             4            64
+hir-stats - Trait                    256 (NN.N%)             4
+hir-stats Block                    288 (NN.N%)             6            48
+hir-stats Pat                      360 (NN.N%)             5            72
+hir-stats - Struct                    72 (NN.N%)             1
+hir-stats - Wild                      72 (NN.N%)             1
+hir-stats - Binding                  216 (NN.N%)             3
+hir-stats GenericParam             400 (NN.N%)             5            80
+hir-stats Generics                 560 (NN.N%)            10            56
+hir-stats Ty                       720 (NN.N%)            15            48
+hir-stats - Ptr                       48 (NN.N%)             1
+hir-stats - Ref                       48 (NN.N%)             1
+hir-stats - Path                     624 (NN.N%)            13
+hir-stats Expr                     768 (NN.N%)            12            64
+hir-stats - InlineAsm                 64 (NN.N%)             1
+hir-stats - Match                     64 (NN.N%)             1
+hir-stats - Path                      64 (NN.N%)             1
+hir-stats - Struct                    64 (NN.N%)             1
+hir-stats - Lit                      128 (NN.N%)             2
+hir-stats - Block                    384 (NN.N%)             6
+hir-stats Item                     968 (NN.N%)            11            88
+hir-stats - Enum                      88 (NN.N%)             1
+hir-stats - ExternCrate               88 (NN.N%)             1
+hir-stats - ForeignMod                88 (NN.N%)             1
+hir-stats - Impl                      88 (NN.N%)             1
+hir-stats - Trait                     88 (NN.N%)             1
+hir-stats - Fn                       176 (NN.N%)             2
+hir-stats - Use                      352 (NN.N%)             4
+hir-stats Path                   1_040 (NN.N%)            26            40
+hir-stats PathSegment            1_776 (NN.N%)            37            48
 hir-stats ----------------------------------------------------------------
-hir-stats Total                  8_988                   180
+hir-stats Total                  8_644                   172
 hir-stats