Use &'hir Expr everywhere.

For consistency, and because it makes HIR measurement simpler and more
accurate.
This commit is contained in:
Nicholas Nethercote 2022-08-26 15:43:00 +10:00
parent 2cdc54d265
commit 3b80e994d5
3 changed files with 4 additions and 4 deletions

View File

@ -178,9 +178,9 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
InlineAsmOperand::In { expr, .. } | InlineAsmOperand::InOut { expr, .. } => {
never_loop_expr(expr, main_loop_id)
},
InlineAsmOperand::Out { expr, .. } => never_loop_expr_all(&mut expr.iter(), main_loop_id),
InlineAsmOperand::Out { expr, .. } => never_loop_expr_all(&mut expr.iter().copied(), main_loop_id),
InlineAsmOperand::SplitInOut { in_expr, out_expr, .. } => {
never_loop_expr_all(&mut once(in_expr).chain(out_expr.iter()), main_loop_id)
never_loop_expr_all(&mut once(*in_expr).chain(out_expr.iter().copied()), main_loop_id)
},
InlineAsmOperand::Const { .. }
| InlineAsmOperand::SymFn { .. }

View File

@ -595,7 +595,7 @@ fn block(&self, block: &Binding<&hir::Block<'_>>) {
}
fn body(&self, body_id: &Binding<hir::BodyId>) {
let expr = &self.cx.tcx.hir().body(body_id.value).value;
let expr = self.cx.tcx.hir().body(body_id.value).value;
bind!(self, expr);
out!("let {expr} = &cx.tcx.hir().body({body_id}).value;");
self.expr(expr);

View File

@ -1804,7 +1804,7 @@ fn is_body_identity_function(cx: &LateContext<'_>, func: &Body<'_>) -> bool {
}
};
let mut expr = &func.value;
let mut expr = func.value;
loop {
match expr.kind {
#[rustfmt::skip]