Use &'hir Expr
everywhere.
For consistency, and because it makes HIR measurement simpler and more accurate.
This commit is contained in:
parent
2cdc54d265
commit
3b80e994d5
@ -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 { .. }
|
||||
|
@ -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);
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user