Change InferCtxtBuilder from enter to build

This commit is contained in:
Cameron Steffen
2022-09-19 22:03:59 -05:00
parent 3b328e7049
commit 6819e85501
10 changed files with 87 additions and 102 deletions

View File

@@ -18,16 +18,15 @@ pub fn mutated_variables<'tcx>(expr: &'tcx Expr<'_>, cx: &LateContext<'tcx>) ->
used_mutably: HirIdSet::default(),
skip: false,
};
cx.tcx.infer_ctxt().enter(|infcx| {
ExprUseVisitor::new(
&mut delegate,
&infcx,
expr.hir_id.owner.def_id,
cx.param_env,
cx.typeck_results(),
)
.walk_expr(expr);
});
let infcx = cx.tcx.infer_ctxt().build();
ExprUseVisitor::new(
&mut delegate,
&infcx,
expr.hir_id.owner.def_id,
cx.param_env,
cx.typeck_results(),
)
.walk_expr(expr);
if delegate.skip {
return None;