|
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_lint_and_note}; |
2 | 2 | use if_chain::if_chain;
|
3 | 3 | use rustc::lint::in_external_macro;
|
4 | 4 | use rustc_lint::{EarlyContext, EarlyLintPass};
|
@@ -140,7 +140,7 @@ fn check_assign(cx: &EarlyContext<'_>, expr: &Expr) {
|
140 | 140 | let op = UnOp::to_string(op);
|
141 | 141 | let eqop_span = lhs.span.between(sub_rhs.span);
|
142 | 142 | if eq_snippet.ends_with('=') {
|
143 |
| - span_note_and_lint( |
| 143 | + span_lint_and_note( |
144 | 144 | cx,
|
145 | 145 | SUSPICIOUS_ASSIGNMENT_FORMATTING,
|
146 | 146 | eqop_span,
|
@@ -178,7 +178,7 @@ fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) {
|
178 | 178 | then {
|
179 | 179 | let unop_str = UnOp::to_string(op);
|
180 | 180 | let eqop_span = lhs.span.between(un_rhs.span);
|
181 |
| - span_help_and_lint( |
| 181 | + span_lint_and_help( |
182 | 182 | cx,
|
183 | 183 | SUSPICIOUS_UNARY_OP_FORMATTING,
|
184 | 184 | eqop_span,
|
@@ -221,7 +221,7 @@ fn check_else(cx: &EarlyContext<'_>, expr: &Expr) {
|
221 | 221 | let else_desc = if is_if(else_) { "if" } else { "{..}" };
|
222 | 222 |
|
223 | 223 | then {
|
224 |
| - span_note_and_lint( |
| 224 | + span_lint_and_note( |
225 | 225 | cx,
|
226 | 226 | SUSPICIOUS_ELSE_FORMATTING,
|
227 | 227 | else_span,
|
@@ -260,7 +260,7 @@ fn check_array(cx: &EarlyContext<'_>, expr: &Expr) {
|
260 | 260 | if space_snippet.contains('\n');
|
261 | 261 | if indentation(cx, op.span) <= indentation(cx, lhs.span);
|
262 | 262 | then {
|
263 |
| - span_note_and_lint( |
| 263 | + span_lint_and_note( |
264 | 264 | cx,
|
265 | 265 | POSSIBLE_MISSING_COMMA,
|
266 | 266 | lint_span,
|
@@ -291,7 +291,7 @@ fn check_missing_else(cx: &EarlyContext<'_>, first: &Expr, second: &Expr) {
|
291 | 291 | ("an `else {..}`", "the next block")
|
292 | 292 | };
|
293 | 293 |
|
294 |
| - span_note_and_lint( |
| 294 | + span_lint_and_note( |
295 | 295 | cx,
|
296 | 296 | SUSPICIOUS_ELSE_FORMATTING,
|
297 | 297 | else_span,
|
|
0 commit comments