Fix arguments on ExprUseVisitor::new

This commit is contained in:
Manish Goregaokar 2019-11-28 07:20:37 -08:00
parent dc9d839410
commit c1c5c3522d
4 changed files with 2 additions and 8 deletions

View File

@ -76,8 +76,7 @@ fn check_fn(
};
let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
ExprUseVisitor::new(&mut v, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables).consume_body(body);
ExprUseVisitor::new(&mut v, cx.tcx, fn_def_id, cx.param_env, cx.tables).consume_body(body);
for node in v.set {
span_lint(

View File

@ -1678,13 +1678,11 @@ fn check_for_mutation(
span_high: None,
};
let def_id = def_id::DefId::local(body.hir_id.owner);
let region_scope_tree = &cx.tcx.region_scope_tree(def_id);
ExprUseVisitor::new(
&mut delegate,
cx.tcx,
def_id,
cx.param_env,
region_scope_tree,
cx.tables,
)
.walk_expr(body);

View File

@ -134,8 +134,7 @@ fn check_fn(
..
} = {
let mut ctx = MovedVariablesCtxt::default();
let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
euv::ExprUseVisitor::new(&mut ctx, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables)
euv::ExprUseVisitor::new(&mut ctx, cx.tcx, fn_def_id, cx.param_env, cx.tables)
.consume_body(body);
ctx
};

View File

@ -12,13 +12,11 @@ pub fn mutated_variables<'a, 'tcx>(expr: &'tcx Expr, cx: &'a LateContext<'a, 'tc
skip: false,
};
let def_id = def_id::DefId::local(expr.hir_id.owner);
let region_scope_tree = &cx.tcx.region_scope_tree(def_id);
ExprUseVisitor::new(
&mut delegate,
cx.tcx,
def_id,
cx.param_env,
region_scope_tree,
cx.tables,
)
.walk_expr(expr);