From df412ce2083308cbe7c21ce2fc5622bfa8518993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 1 Feb 2018 12:02:22 -0800 Subject: [PATCH] Change offset to `0` --- src/libsyntax/codemap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index fbd9088797e..e980d6e6793 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -598,7 +598,7 @@ impl CodeMap { /// If `sp` points to `"let mut x"`, then a span pointing at `"let "` will be returned. pub fn span_until_non_whitespace(&self, sp: Span) -> Span { if let Ok(snippet) = self.span_to_snippet(sp) { - let mut offset = 1; + let mut offset = 0; // get the bytes width of all the non-whitespace characters for c in snippet.chars().take_while(|c| !c.is_whitespace()) { offset += c.len_utf8();