Skip to content

Commit a3ace5c

Browse files
committed
Cargo fmt
1 parent 9fefe36 commit a3ace5c

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

clippy_lints/src/escape.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
7979

8080
let fn_def_id = cx.tcx.hir().local_def_id_from_hir_id(hir_id);
8181
let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
82-
ExprUseVisitor::new(&mut v, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables, None).consume_body(body);
82+
ExprUseVisitor::new(
83+
&mut v,
84+
cx.tcx,
85+
fn_def_id,
86+
cx.param_env,
87+
region_scope_tree,
88+
cx.tables,
89+
None,
90+
)
91+
.consume_body(body);
8392

8493
for node in v.set {
8594
span_lint(

clippy_lints/src/loops.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,16 @@ fn check_for_mutation(
16621662
};
16631663
let def_id = def_id::DefId::local(body.hir_id.owner);
16641664
let region_scope_tree = &cx.tcx.region_scope_tree(def_id);
1665-
ExprUseVisitor::new(&mut delegate, cx.tcx, def_id, cx.param_env, region_scope_tree, cx.tables, None).walk_expr(body);
1665+
ExprUseVisitor::new(
1666+
&mut delegate,
1667+
cx.tcx,
1668+
def_id,
1669+
cx.param_env,
1670+
region_scope_tree,
1671+
cx.tables,
1672+
None,
1673+
)
1674+
.walk_expr(body);
16661675
delegate.mutation_span()
16671676
}
16681677

clippy_lints/src/needless_pass_by_value.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
137137
} = {
138138
let mut ctx = MovedVariablesCtxt::new(cx);
139139
let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
140-
euv::ExprUseVisitor::new(&mut ctx, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables, None)
141-
.consume_body(body);
140+
euv::ExprUseVisitor::new(
141+
&mut ctx,
142+
cx.tcx,
143+
fn_def_id,
144+
cx.param_env,
145+
region_scope_tree,
146+
cx.tables,
147+
None,
148+
)
149+
.consume_body(body);
142150
ctx
143151
};
144152

clippy_lints/src/utils/usage.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ pub fn mutated_variables<'a, 'tcx: 'a>(expr: &'tcx Expr, cx: &'a LateContext<'a,
1616
};
1717
let def_id = def_id::DefId::local(expr.hir_id.owner);
1818
let region_scope_tree = &cx.tcx.region_scope_tree(def_id);
19-
ExprUseVisitor::new(&mut delegate, cx.tcx, def_id, cx.param_env, region_scope_tree, cx.tables, None).walk_expr(expr);
19+
ExprUseVisitor::new(
20+
&mut delegate,
21+
cx.tcx,
22+
def_id,
23+
cx.param_env,
24+
region_scope_tree,
25+
cx.tables,
26+
None,
27+
)
28+
.walk_expr(expr);
2029

2130
if delegate.skip {
2231
return None;
@@ -32,7 +41,7 @@ pub fn is_potentially_mutated<'a, 'tcx: 'a>(
3241
if let Res::Local(id) = variable.res {
3342
mutated_variables(expr, cx).map_or(true, |mutated| mutated.contains(&id))
3443
} else {
35-
return true
44+
return true;
3645
}
3746
}
3847

0 commit comments

Comments
 (0)