From a8f77e12fca0072d08745feb8c32900c5a46967a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 15 Jan 2018 13:01:05 -0800 Subject: [PATCH] Include space in suggestion `mut` in bindings --- src/librustc_borrowck/borrowck/unused.rs | 2 +- src/test/ui/lint/suggestions.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_borrowck/borrowck/unused.rs b/src/librustc_borrowck/borrowck/unused.rs index ddee122d0a6b..f00a1c24bc35 100644 --- a/src/librustc_borrowck/borrowck/unused.rs +++ b/src/librustc_borrowck/borrowck/unused.rs @@ -77,7 +77,7 @@ impl<'a, 'tcx> UnusedMutCx<'a, 'tcx> { continue } - let mut_span = tcx.sess.codemap().span_until_char(ids[0].2, ' '); + let mut_span = tcx.sess.codemap().span_through_char(ids[0].2, ' '); // Ok, every name wasn't used mutably, so issue a warning that this // didn't need to be mutable. diff --git a/src/test/ui/lint/suggestions.stderr b/src/test/ui/lint/suggestions.stderr index 8b30f552d377..d04884d29cca 100644 --- a/src/test/ui/lint/suggestions.stderr +++ b/src/test/ui/lint/suggestions.stderr @@ -22,7 +22,7 @@ warning: variable does not need to be mutable --> $DIR/suggestions.rs:46:13 | 46 | let mut a = (1); // should suggest no `mut`, no parens - | ---^^ + | ----^ | | | help: remove this `mut` |