Skip to content

Commit f60f12f

Browse files
committed
Rename span_help_and_lint to span_lint_and_help
1 parent 4f65bec commit f60f12f

32 files changed

+90
-90
lines changed

clippy_lints/src/as_conversions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
33
use rustc_session::{declare_lint_pass, declare_tool_lint};
44
use syntax::ast::*;
55

6-
use crate::utils::span_help_and_lint;
6+
use crate::utils::span_lint_and_help;
77

88
declare_clippy_lint! {
99
/// **What it does:** Checks for usage of `as` conversions.
@@ -45,7 +45,7 @@ impl EarlyLintPass for AsConversions {
4545
}
4646

4747
if let ExprKind::Cast(_, _) = expr.kind {
48-
span_help_and_lint(
48+
span_lint_and_help(
4949
cx,
5050
AS_CONVERSIONS,
5151
expr.span,

clippy_lints/src/assertions_on_constants.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::consts::{constant, Constant};
22
use crate::utils::paths;
3-
use crate::utils::{is_direct_expn_of, is_expn_of, match_function_call, snippet_opt, span_help_and_lint};
3+
use crate::utils::{is_direct_expn_of, is_expn_of, match_function_call, snippet_opt, span_lint_and_help};
44
use if_chain::if_chain;
55
use rustc_hir::*;
66
use rustc_lint::{LateContext, LateLintPass};
@@ -34,7 +34,7 @@ declare_lint_pass!(AssertionsOnConstants => [ASSERTIONS_ON_CONSTANTS]);
3434
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssertionsOnConstants {
3535
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr<'_>) {
3636
let lint_true = |is_debug: bool| {
37-
span_help_and_lint(
37+
span_lint_and_help(
3838
cx,
3939
ASSERTIONS_ON_CONSTANTS,
4040
e.span,
@@ -47,7 +47,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssertionsOnConstants {
4747
);
4848
};
4949
let lint_false_without_message = || {
50-
span_help_and_lint(
50+
span_lint_and_help(
5151
cx,
5252
ASSERTIONS_ON_CONSTANTS,
5353
e.span,
@@ -56,7 +56,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssertionsOnConstants {
5656
);
5757
};
5858
let lint_false_with_message = |panic_message: String| {
59-
span_help_and_lint(
59+
span_lint_and_help(
6060
cx,
6161
ASSERTIONS_ON_CONSTANTS,
6262
e.span,

clippy_lints/src/atomic_ordering.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{match_def_path, span_help_and_lint};
1+
use crate::utils::{match_def_path, span_lint_and_help};
22
use if_chain::if_chain;
33
use rustc::ty;
44
use rustc_hir::def_id::DefId;
@@ -80,7 +80,7 @@ fn check_atomic_load_store(cx: &LateContext<'_, '_>, expr: &Expr<'_>) {
8080
then {
8181
if method == "load" &&
8282
match_ordering_def_path(cx, ordering_def_id, &["Release", "AcqRel"]) {
83-
span_help_and_lint(
83+
span_lint_and_help(
8484
cx,
8585
INVALID_ATOMIC_ORDERING,
8686
ordering_arg.span,
@@ -89,7 +89,7 @@ fn check_atomic_load_store(cx: &LateContext<'_, '_>, expr: &Expr<'_>) {
8989
);
9090
} else if method == "store" &&
9191
match_ordering_def_path(cx, ordering_def_id, &["Acquire", "AcqRel"]) {
92-
span_help_and_lint(
92+
span_lint_and_help(
9393
cx,
9494
INVALID_ATOMIC_ORDERING,
9595
ordering_arg.span,
@@ -113,7 +113,7 @@ fn check_memory_fence(cx: &LateContext<'_, '_>, expr: &Expr<'_>) {
113113
if let Some(ordering_def_id) = cx.tables.qpath_res(ordering_qpath, args[0].hir_id).opt_def_id();
114114
if match_ordering_def_path(cx, ordering_def_id, &["Relaxed"]);
115115
then {
116-
span_help_and_lint(
116+
span_lint_and_help(
117117
cx,
118118
INVALID_ATOMIC_ORDERING,
119119
args[0].span,

clippy_lints/src/block_in_if_condition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition {
8989
if expr.span.from_expansion() || differing_macro_contexts(expr.span, ex.span) {
9090
return;
9191
}
92-
span_help_and_lint(
92+
span_lint_and_help(
9393
cx,
9494
BLOCK_IN_IF_CONDITION_EXPR,
9595
check.span,
@@ -107,7 +107,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition {
107107
return;
108108
}
109109
// move block higher
110-
span_help_and_lint(
110+
span_lint_and_help(
111111
cx,
112112
BLOCK_IN_IF_CONDITION_STMT,
113113
check.span,

clippy_lints/src/cognitive_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_span::source_map::Span;
99
use rustc_span::BytePos;
1010
use syntax::ast::Attribute;
1111

12-
use crate::utils::{match_type, paths, snippet_opt, span_help_and_lint, LimitStack};
12+
use crate::utils::{match_type, paths, snippet_opt, span_lint_and_help, LimitStack};
1313

1414
declare_clippy_lint! {
1515
/// **What it does:** Checks for methods with high cognitive complexity.
@@ -96,7 +96,7 @@ impl CognitiveComplexity {
9696
},
9797
};
9898

99-
span_help_and_lint(
99+
span_lint_and_help(
100100
cx,
101101
COGNITIVE_COMPLEXITY,
102102
fn_span,

clippy_lints/src/comparison_chain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::utils::{
2-
get_trait_def_id, if_sequence, implements_trait, parent_node_is_if_expr, paths, span_help_and_lint, SpanlessEq,
2+
get_trait_def_id, if_sequence, implements_trait, parent_node_is_if_expr, paths, span_lint_and_help, SpanlessEq,
33
};
44
use rustc_hir::*;
55
use rustc_lint::{LateContext, LateLintPass};
@@ -99,7 +99,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ComparisonChain {
9999
return;
100100
}
101101
}
102-
span_help_and_lint(
102+
span_lint_and_help(
103103
cx,
104104
COMPARISON_CHAIN,
105105
expr.span,

clippy_lints/src/dbg_macro.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{snippet_opt, span_help_and_lint, span_lint_and_sugg};
1+
use crate::utils::{snippet_opt, span_lint_and_help, span_lint_and_sugg};
22
use rustc_errors::Applicability;
33
use rustc_lint::{EarlyContext, EarlyLintPass};
44
use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -43,7 +43,7 @@ impl EarlyLintPass for DbgMacro {
4343
Applicability::MaybeIncorrect,
4444
);
4545
} else {
46-
span_help_and_lint(
46+
span_lint_and_help(
4747
cx,
4848
DBG_MACRO,
4949
mac.span(),

clippy_lints/src/else_if_without_else.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
55
use rustc_session::{declare_lint_pass, declare_tool_lint};
66
use syntax::ast::*;
77

8-
use crate::utils::span_help_and_lint;
8+
use crate::utils::span_lint_and_help;
99

1010
declare_clippy_lint! {
1111
/// **What it does:** Checks for usage of if expressions with an `else if` branch,
@@ -56,7 +56,7 @@ impl EarlyLintPass for ElseIfWithoutElse {
5656

5757
while let ExprKind::If(_, _, Some(ref els)) = item.kind {
5858
if let ExprKind::If(_, _, None) = els.kind {
59-
span_help_and_lint(
59+
span_lint_and_help(
6060
cx,
6161
ELSE_IF_WITHOUT_ELSE,
6262
els.span,

clippy_lints/src/enum_variants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! lint on enum variants that are prefixed or suffixed by the same characters
22
33
use crate::utils::{camel_case, is_present_in_source};
4-
use crate::utils::{span_help_and_lint, span_lint};
4+
use crate::utils::{span_lint, span_lint_and_help};
55
use rustc_lint::{EarlyContext, EarlyLintPass, Lint};
66
use rustc_session::{declare_tool_lint, impl_lint_pass};
77
use rustc_span::source_map::Span;
@@ -201,7 +201,7 @@ fn check_variant(
201201
(false, _) => ("pre", pre),
202202
(true, false) => ("post", post),
203203
};
204-
span_help_and_lint(
204+
span_lint_and_help(
205205
cx,
206206
lint,
207207
span,

clippy_lints/src/formatting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{differing_macro_contexts, snippet_opt, span_help_and_lint, span_note_and_lint};
1+
use crate::utils::{differing_macro_contexts, snippet_opt, span_lint_and_help, span_note_and_lint};
22
use if_chain::if_chain;
33
use rustc::lint::in_external_macro;
44
use rustc_lint::{EarlyContext, EarlyLintPass};
@@ -178,7 +178,7 @@ fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) {
178178
then {
179179
let unop_str = UnOp::to_string(op);
180180
let eqop_span = lhs.span.between(un_rhs.span);
181-
span_help_and_lint(
181+
span_lint_and_help(
182182
cx,
183183
SUSPICIOUS_UNARY_OP_FORMATTING,
184184
eqop_span,

clippy_lints/src/functions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::utils::{
22
attr_by_name, attrs::is_proc_macro, is_must_use_ty, iter_input_pats, match_def_path, must_use_attr, qpath_res,
3-
return_ty, snippet, snippet_opt, span_help_and_lint, span_lint, span_lint_and_then, trait_ref_of_method,
3+
return_ty, snippet, snippet_opt, span_lint, span_lint_and_help, span_lint_and_then, trait_ref_of_method,
44
type_is_unsafe_function,
55
};
66
use matches::matches;
@@ -433,7 +433,7 @@ fn check_needless_must_use(
433433
},
434434
);
435435
} else if !attr.is_value_str() && is_must_use_ty(cx, return_ty(cx, item_id)) {
436-
span_help_and_lint(
436+
span_lint_and_help(
437437
cx,
438438
DOUBLE_MUST_USE,
439439
fn_header_span,

clippy_lints/src/if_not_else.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
66
use rustc_session::{declare_lint_pass, declare_tool_lint};
77
use syntax::ast::*;
88

9-
use crate::utils::span_help_and_lint;
9+
use crate::utils::span_lint_and_help;
1010

1111
declare_clippy_lint! {
1212
/// **What it does:** Checks for usage of `!` or `!=` in an if condition with an
@@ -56,7 +56,7 @@ impl EarlyLintPass for IfNotElse {
5656
if let ExprKind::Block(..) = els.kind {
5757
match cond.kind {
5858
ExprKind::Unary(UnOp::Not, _) => {
59-
span_help_and_lint(
59+
span_lint_and_help(
6060
cx,
6161
IF_NOT_ELSE,
6262
item.span,
@@ -65,7 +65,7 @@ impl EarlyLintPass for IfNotElse {
6565
);
6666
},
6767
ExprKind::Binary(ref kind, _, _) if kind.node == BinOpKind::Ne => {
68-
span_help_and_lint(
68+
span_lint_and_help(
6969
cx,
7070
IF_NOT_ELSE,
7171
item.span,

clippy_lints/src/indexing_slicing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for IndexingSlicing {
136136
(None, None) => return, // [..] is ok.
137137
};
138138

139-
utils::span_help_and_lint(cx, INDEXING_SLICING, expr.span, "slicing may panic.", help_msg);
139+
utils::span_lint_and_help(cx, INDEXING_SLICING, expr.span, "slicing may panic.", help_msg);
140140
} else {
141141
// Catchall non-range index, i.e., [n] or [n << m]
142142
if let ty::Array(..) = ty.kind {
@@ -147,7 +147,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for IndexingSlicing {
147147
}
148148
}
149149

150-
utils::span_help_and_lint(
150+
utils::span_lint_and_help(
151151
cx,
152152
INDEXING_SLICING,
153153
expr.span,

clippy_lints/src/inherent_to_string.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_lint::{LateContext, LateLintPass};
44
use rustc_session::{declare_lint_pass, declare_tool_lint};
55

66
use crate::utils::{
7-
get_trait_def_id, implements_trait, match_type, paths, return_ty, span_help_and_lint, trait_ref_of_method,
7+
get_trait_def_id, implements_trait, match_type, paths, return_ty, span_lint_and_help, trait_ref_of_method,
88
walk_ptrs_ty,
99
};
1010

@@ -130,7 +130,7 @@ fn show_lint(cx: &LateContext<'_, '_>, item: &ImplItem<'_>) {
130130

131131
// Emit either a warning or an error
132132
if implements_trait(cx, self_type, display_trait_id, &[]) {
133-
span_help_and_lint(
133+
span_lint_and_help(
134134
cx,
135135
INHERENT_TO_STRING_SHADOW_DISPLAY,
136136
item.span,
@@ -141,7 +141,7 @@ fn show_lint(cx: &LateContext<'_, '_>, item: &ImplItem<'_>) {
141141
&format!("remove the inherent method from type `{}`", self_type.to_string())
142142
);
143143
} else {
144-
span_help_and_lint(
144+
span_lint_and_help(
145145
cx,
146146
INHERENT_TO_STRING,
147147
item.span,

clippy_lints/src/integer_division.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::span_help_and_lint;
1+
use crate::utils::span_lint_and_help;
22
use if_chain::if_chain;
33
use rustc_hir as hir;
44
use rustc_lint::{LateContext, LateLintPass};
@@ -30,7 +30,7 @@ declare_lint_pass!(IntegerDivision => [INTEGER_DIVISION]);
3030
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for IntegerDivision {
3131
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr<'_>) {
3232
if is_integer_division(cx, expr) {
33-
span_help_and_lint(
33+
span_lint_and_help(
3434
cx,
3535
INTEGER_DIVISION,
3636
expr.span,

clippy_lints/src/large_stack_arrays.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_session::{declare_tool_lint, impl_lint_pass};
77
use if_chain::if_chain;
88

99
use crate::rustc_target::abi::LayoutOf;
10-
use crate::utils::{snippet, span_help_and_lint};
10+
use crate::utils::{snippet, span_lint_and_help};
1111

1212
declare_clippy_lint! {
1313
/// **What it does:** Checks for local arrays that may be too large.
@@ -49,7 +49,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeStackArrays {
4949
if let Ok(element_size) = cx.layout_of(element_type).map(|l| l.size.bytes());
5050
if self.maximum_allowed_size < element_count * element_size;
5151
then {
52-
span_help_and_lint(
52+
span_lint_and_help(
5353
cx,
5454
LARGE_STACK_ARRAYS,
5555
expr.span,

clippy_lints/src/let_underscore.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_hir::*;
44
use rustc_lint::{LateContext, LateLintPass};
55
use rustc_session::{declare_lint_pass, declare_tool_lint};
66

7-
use crate::utils::{is_must_use_func_call, is_must_use_ty, span_help_and_lint};
7+
use crate::utils::{is_must_use_func_call, is_must_use_ty, span_lint_and_help};
88

99
declare_clippy_lint! {
1010
/// **What it does:** Checks for `let _ = <expr>`
@@ -44,15 +44,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetUnderscore {
4444
if let Some(ref init) = local.init;
4545
then {
4646
if is_must_use_ty(cx, cx.tables.expr_ty(init)) {
47-
span_help_and_lint(
47+
span_lint_and_help(
4848
cx,
4949
LET_UNDERSCORE_MUST_USE,
5050
stmt.span,
5151
"non-binding let on an expression with `#[must_use]` type",
5252
"consider explicitly using expression value"
5353
)
5454
} else if is_must_use_func_call(cx, init) {
55-
span_help_and_lint(
55+
span_lint_and_help(
5656
cx,
5757
LET_UNDERSCORE_MUST_USE,
5858
stmt.span,

clippy_lints/src/loops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::utils::usage::{is_unused, mutated_variables};
55
use crate::utils::{
66
get_enclosing_block, get_parent_expr, get_trait_def_id, has_iter_method, higher, implements_trait,
77
is_integer_const, is_no_std_crate, is_refutable, last_path_segment, match_trait_method, match_type, match_var,
8-
multispan_sugg, snippet, snippet_opt, snippet_with_applicability, span_help_and_lint, span_lint,
8+
multispan_sugg, snippet, snippet_opt, snippet_with_applicability, span_lint, span_lint_and_help,
99
span_lint_and_sugg, span_lint_and_then, SpanlessEq,
1010
};
1111
use crate::utils::{is_type_diagnostic_item, qpath_res, same_tys, sext, sugg};
@@ -1390,7 +1390,7 @@ fn check_for_loop_arg(cx: &LateContext<'_, '_>, pat: &Pat<'_>, arg: &Expr<'_>, e
13901390
fn check_arg_type(cx: &LateContext<'_, '_>, pat: &Pat<'_>, arg: &Expr<'_>) {
13911391
let ty = cx.tables.expr_ty(arg);
13921392
if match_type(cx, ty, &paths::OPTION) {
1393-
span_help_and_lint(
1393+
span_lint_and_help(
13941394
cx,
13951395
FOR_LOOP_OVER_OPTION,
13961396
arg.span,
@@ -1406,7 +1406,7 @@ fn check_arg_type(cx: &LateContext<'_, '_>, pat: &Pat<'_>, arg: &Expr<'_>) {
14061406
),
14071407
);
14081408
} else if match_type(cx, ty, &paths::RESULT) {
1409-
span_help_and_lint(
1409+
span_lint_and_help(
14101410
cx,
14111411
FOR_LOOP_OVER_RESULT,
14121412
arg.span,

clippy_lints/src/main_recursion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_hir::{Crate, Expr, ExprKind, QPath};
22
use rustc_lint::{LateContext, LateLintPass};
33
use rustc_session::{declare_tool_lint, impl_lint_pass};
44

5-
use crate::utils::{is_entrypoint_fn, is_no_std_crate, snippet, span_help_and_lint};
5+
use crate::utils::{is_entrypoint_fn, is_no_std_crate, snippet, span_lint_and_help};
66
use if_chain::if_chain;
77

88
declare_clippy_lint! {
@@ -48,7 +48,7 @@ impl LateLintPass<'_, '_> for MainRecursion {
4848
if let Some(def_id) = path.res.opt_def_id();
4949
if is_entrypoint_fn(cx, def_id);
5050
then {
51-
span_help_and_lint(
51+
span_lint_and_help(
5252
cx,
5353
MAIN_RECURSION,
5454
func.span,

0 commit comments

Comments
 (0)