]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_passes/src/hir_stats.rs
Rollup merge of #96763 - Abdur-rahmaanJ:patch-1, r=Mark-Simulacrum
[rust.git] / compiler / rustc_passes / src / hir_stats.rs
index a7854cd49988f721806864a33570b646bc5379d2..51a19c8e3c02ba227bfdb3b792c208a5ada546e0 100644 (file)
@@ -12,6 +12,7 @@
 use rustc_middle::hir::map::Map;
 use rustc_middle::ty::TyCtxt;
 use rustc_middle::util::common::to_readable_str;
+use rustc_span::def_id::LocalDefId;
 use rustc_span::Span;
 
 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
@@ -121,7 +122,7 @@ fn record_inner<T>(
 
     fn print(&self, title: &str, prefix: &str) {
         let mut nodes: Vec<_> = self.nodes.iter().collect();
-        nodes.sort_by_key(|&(_, ref node)| node.stats.count * node.stats.size);
+        nodes.sort_by_key(|(_, node)| node.stats.count * node.stats.size);
 
         let total_size = nodes.iter().map(|(_, node)| node.stats.count * node.stats.size).sum();
 
@@ -147,7 +148,7 @@ fn print(&self, title: &str, prefix: &str) {
             );
             if !node.subnodes.is_empty() {
                 let mut subnodes: Vec<_> = node.subnodes.iter().collect();
-                subnodes.sort_by_key(|&(_, ref subnode)| subnode.count * subnode.size);
+                subnodes.sort_by_key(|(_, subnode)| subnode.count * subnode.size);
 
                 for (label, subnode) in subnodes {
                     let size = subnode.count * subnode.size;
@@ -324,7 +325,7 @@ fn visit_ty(&mut self, t: &'v hir::Ty<'v>) {
                 Slice,
                 Array,
                 Ptr,
-                Rptr,
+                Ref,
                 BareFn,
                 Never,
                 Tup,
@@ -363,7 +364,7 @@ fn visit_fn(
         fd: &'v hir::FnDecl<'v>,
         b: hir::BodyId,
         _: Span,
-        id: hir::HirId,
+        id: LocalDefId,
     ) {
         self.record("FnDecl", Id::None, fd);
         hir_visit::walk_fn(self, fk, fd, b, id)
@@ -567,7 +568,7 @@ fn visit_expr(&mut self, e: &'v ast::Expr) {
                 Box, Array, ConstBlock, Call, MethodCall, Tup, Binary, Unary, Lit, Cast, Type, Let,
                 If, While, ForLoop, Loop, Match, Closure, Block, Async, Await, TryBlock, Assign,
                 AssignOp, Field, Index, Range, Underscore, Path, AddrOf, Break, Continue, Ret,
-                InlineAsm, MacCall, Struct, Repeat, Paren, Try, Yield, Yeet, IncludedBytes, Err
+                InlineAsm, FormatArgs, MacCall, Struct, Repeat, Paren, Try, Yield, Yeet, IncludedBytes, Err
             ]
         );
         ast_visit::walk_expr(self, e)
@@ -580,7 +581,7 @@ fn visit_ty(&mut self, t: &'v ast::Ty) {
                 Slice,
                 Array,
                 Ptr,
-                Rptr,
+                Ref,
                 BareFn,
                 Never,
                 Tup,