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

Commit 3b80e99

Browse files
committed
Use &'hir Expr everywhere.
For consistency, and because it makes HIR measurement simpler and more accurate.
1 parent 2cdc54d commit 3b80e99

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
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/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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ pub fn is_expr_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool
18041804
}
18051805
};
18061806

1807-
let mut expr = &func.value;
1807+
let mut expr = func.value;
18081808
loop {
18091809
match expr.kind {
18101810
#[rustfmt::skip]

0 commit comments

Comments
 (0)