Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 9ae3292

Browse files
authored
Rollup merge of rust-lang#101142 - nnethercote:improve-hir-stats, r=davidtwco
Improve HIR stats rust-lang#100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
2 parents 5b784f8 + 3ce109e commit 9ae3292

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

clippy_lints/src/loops/never_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
178178
InlineAsmOperand::In { expr, .. } | InlineAsmOperand::InOut { expr, .. } => {
179179
never_loop_expr(expr, main_loop_id)
180180
},
181-
InlineAsmOperand::Out { expr, .. } => never_loop_expr_all(&mut expr.iter(), main_loop_id),
181+
InlineAsmOperand::Out { expr, .. } => never_loop_expr_all(&mut expr.iter().copied(), main_loop_id),
182182
InlineAsmOperand::SplitInOut { in_expr, out_expr, .. } => {
183-
never_loop_expr_all(&mut once(in_expr).chain(out_expr.iter()), main_loop_id)
183+
never_loop_expr_all(&mut once(*in_expr).chain(out_expr.iter().copied()), main_loop_id)
184184
},
185185
InlineAsmOperand::Const { .. }
186186
| InlineAsmOperand::SymFn { .. }

clippy_lints/src/manual_bits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn get_size_of_ty<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<
105105
if let Some(def_id) = cx.qpath_res(count_func_qpath, count_func.hir_id).opt_def_id();
106106
if cx.tcx.is_diagnostic_item(sym::mem_size_of, def_id);
107107
then {
108-
cx.typeck_results().node_substs(count_func.hir_id).types().next().map(|resolved_ty| (real_ty, resolved_ty))
108+
cx.typeck_results().node_substs(count_func.hir_id).types().next().map(|resolved_ty| (*real_ty, resolved_ty))
109109
} else {
110110
None
111111
}

clippy_lints/src/utils/author.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
595595
}
596596

597597
fn body(&self, body_id: &Binding<hir::BodyId>) {
598-
let expr = &self.cx.tcx.hir().body(body_id.value).value;
598+
let expr = self.cx.tcx.hir().body(body_id.value).value;
599599
bind!(self, expr);
600600
out!("let {expr} = &cx.tcx.hir().body({body_id}).value;");
601601
self.expr(expr);

clippy_utils/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ pub fn qpath_generic_tys<'tcx>(qpath: &QPath<'tcx>) -> impl Iterator<Item = &'tc
337337
.map_or(&[][..], |a| a.args)
338338
.iter()
339339
.filter_map(|a| match a {
340-
hir::GenericArg::Type(ty) => Some(ty),
340+
hir::GenericArg::Type(ty) => Some(*ty),
341341
_ => None,
342342
})
343343
}
@@ -1812,7 +1812,7 @@ pub fn is_expr_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool
18121812
}
18131813
};
18141814

1815-
let mut expr = &func.value;
1815+
let mut expr = func.value;
18161816
loop {
18171817
match expr.kind {
18181818
#[rustfmt::skip]

0 commit comments

Comments
 (0)