From e70f9456fcc2cafae9a94611e0e0dd6bc2fa6cb9 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Tue, 22 Jan 2019 14:43:59 +0100 Subject: [PATCH] Improve span shortening. Co-Authored-By: daxpedda <1645124+daxpedda@users.noreply.github.com> --- clippy_lints/src/use_self.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index b57847d8f4b0..5d4d5bac4c7c 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -60,7 +60,7 @@ fn span_use_self_lint(cx: &LateContext<'_, '_>, path: &Path) { let last_path_span = path.segments.last().expect(SEGMENTS_MSG).ident.span; // `to()` doesn't shorten span, so we shorten it with `until(..)` // and then include it with `to(..)` - let span = path.span.until(last_path_span).to(last_path_span); + let span = path.span.with_hi(last_path_span.hi()); span_lint_and_sugg( cx,