Skip to content

Commit

Permalink
Fix arguments on ExprUseVisitor::new
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Nov 28, 2019
1 parent dc9d839 commit c1c5c35
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions clippy_lints/src/escape.rs
Expand Up @@ -76,8 +76,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
};

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(
Expand Down
2 changes: 0 additions & 2 deletions clippy_lints/src/loops.rs
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions clippy_lints/src/needless_pass_by_value.rs
Expand Up @@ -134,8 +134,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
..
} = {
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
};
Expand Down
2 changes: 0 additions & 2 deletions clippy_lints/src/utils/usage.rs
Expand Up @@ -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);
Expand Down

0 comments on commit c1c5c35

Please sign in to comment.