Skip to content

Commit 3aa531c

Browse files
committed
Run util/dev fmt
1 parent 3b23092 commit 3aa531c

File tree

4 files changed

+11
-35
lines changed

4 files changed

+11
-35
lines changed

clippy_lints/src/escape.rs

+2-14
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
7878

7979
let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
8080
let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
81-
ExprUseVisitor::new(
82-
&mut v,
83-
cx.tcx,
84-
fn_def_id,
85-
cx.param_env,
86-
region_scope_tree,
87-
cx.tables,
88-
)
89-
.consume_body(body);
81+
ExprUseVisitor::new(&mut v, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables).consume_body(body);
9082

9183
for node in v.set {
9284
span_lint(
@@ -145,11 +137,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
145137
}
146138
}
147139

148-
fn borrow(
149-
&mut self,
150-
cmt: &cmt_<'tcx>,
151-
_: ty::BorrowKind,
152-
) {
140+
fn borrow(&mut self, cmt: &cmt_<'tcx>, _: ty::BorrowKind) {
153141
if let Categorization::Local(lid) = cmt.cat {
154142
self.set.remove(&lid);
155143
}

clippy_lints/src/methods/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ use syntax::symbol::{sym, LocalInternedString, Symbol};
2121
use crate::utils::usage::mutated_variables;
2222
use crate::utils::{
2323
get_arg_name, get_parent_expr, get_trait_def_id, has_iter_method, implements_trait, in_macro, is_copy,
24-
is_ctor_or_promotable_const_function, is_expn_of, is_type_diagnostic_item, iter_input_pats, last_path_segment, match_def_path,
25-
match_qpath, match_trait_method, match_type, match_var, method_calls, method_chain_args, paths, remove_blocks,
26-
return_ty, same_tys, single_segment_path, snippet, snippet_with_applicability, snippet_with_macro_callsite,
27-
span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, sugg, walk_ptrs_ty,
28-
walk_ptrs_ty_depth, SpanlessEq,
24+
is_ctor_or_promotable_const_function, is_expn_of, is_type_diagnostic_item, iter_input_pats, last_path_segment,
25+
match_def_path, match_qpath, match_trait_method, match_type, match_var, method_calls, method_chain_args, paths,
26+
remove_blocks, return_ty, same_tys, single_segment_path, snippet, snippet_with_applicability,
27+
snippet_with_macro_callsite, span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then,
28+
span_note_and_lint, sugg, walk_ptrs_ty, walk_ptrs_ty_depth, SpanlessEq,
2929
};
3030

3131
declare_clippy_lint! {

clippy_lints/src/needless_pass_by_value.rs

+3-15
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
136136
} = {
137137
let mut ctx = MovedVariablesCtxt::default();
138138
let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id);
139-
euv::ExprUseVisitor::new(
140-
&mut ctx,
141-
cx.tcx,
142-
fn_def_id,
143-
cx.param_env,
144-
region_scope_tree,
145-
cx.tables,
146-
)
147-
.consume_body(body);
139+
euv::ExprUseVisitor::new(&mut ctx, cx.tcx, fn_def_id, cx.param_env, region_scope_tree, cx.tables)
140+
.consume_body(body);
148141
ctx
149142
};
150143

@@ -349,12 +342,7 @@ impl<'tcx> euv::Delegate<'tcx> for MovedVariablesCtxt {
349342
}
350343
}
351344

352-
fn borrow(
353-
&mut self,
354-
_: &mc::cmt_<'tcx>,
355-
_: ty::BorrowKind,
356-
) {
357-
}
345+
fn borrow(&mut self, _: &mc::cmt_<'tcx>, _: ty::BorrowKind) {}
358346

359347
fn mutate(&mut self, _: &mc::cmt_<'tcx>) {}
360348
}

clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ pub fn is_ctor_or_promotable_const_function(cx: &LateContext<'_, '_>, expr: &Exp
811811
def::Res::Def(DefKind::Variant, ..) | Res::Def(DefKind::Ctor(..), _) => true,
812812
def::Res::Def(_, def_id) => cx.tcx.is_promotable_const_fn(def_id),
813813
_ => false,
814-
}
814+
};
815815
}
816816
}
817817
false

0 commit comments

Comments
 (0)