]> git.lizzy.rs Git - rust.git/commitdiff
Fix span in `REVERSE_RANGE_LOOP`’s suggestion
authormcarton <cartonmartin+git@gmail.com>
Tue, 7 Jun 2016 15:58:52 +0000 (17:58 +0200)
committermcarton <cartonmartin+git@gmail.com>
Tue, 7 Jun 2016 15:58:52 +0000 (17:58 +0200)
clippy_lints/src/loops.rs

index 664ff21994eb78c1772a0df0d1b00c89194ab057..e635b34e1de6bc87ba606f2517a848637e61e671 100644 (file)
@@ -446,7 +446,7 @@ fn check_for_loop_reverse_range(cx: &LateContext, arg: &Expr, expr: &Expr) {
                                        expr.span,
                                        "this range is empty so this for loop will never run",
                                        |db| {
-                                           db.span_suggestion(expr.span,
+                                           db.span_suggestion(arg.span,
                                                               "consider using the following if \
                                                                you are attempting to iterate \
                                                                over this range in reverse",