Add an indirection for closures in hir::ExprKind
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
This commit is contained in:
parent
3ebb852956
commit
df4fee9841
26 changed files with 101 additions and 79 deletions
|
@ -6,7 +6,7 @@ use rustc_hir::def::Res;
|
|||
use rustc_hir::def::{CtorOf, DefKind, Namespace};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::intravisit::{self, Visitor};
|
||||
use rustc_hir::{Body, Expr, ExprKind, FnRetTy, HirId, Local, LocalSource};
|
||||
use rustc_hir::{Body, Closure, Expr, ExprKind, FnRetTy, HirId, Local, LocalSource};
|
||||
use rustc_middle::hir::nested_filter;
|
||||
use rustc_middle::infer::unify_key::ConstVariableOriginKind;
|
||||
use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow, AutoBorrowMutability};
|
||||
|
@ -1051,7 +1051,7 @@ impl<'a, 'tcx> Visitor<'tcx> for FindInferSourceVisitor<'a, 'tcx> {
|
|||
|
||||
if let Some(node_ty) = self.opt_node_type(expr.hir_id) {
|
||||
if let (
|
||||
&ExprKind::Closure { fn_decl, body, fn_decl_span, .. },
|
||||
&ExprKind::Closure(&Closure { fn_decl, body, fn_decl_span, .. }),
|
||||
ty::Closure(_, substs),
|
||||
) = (&expr.kind, node_ty.kind())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue