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,

0 commit comments

Comments
 (0)