]> git.lizzy.rs Git - rust.git/blobdiff - src/missed_spans.rs
Merge pull request #3011 from topecongiro/rustc-ap-syntax
[rust.git] / src / missed_spans.rs
index f61098ed87903e0e26732b8256560ee57fbd30ea..f2f2295a8720b30ea2c203186d9ffa905c9840d9 100644 (file)
 
 use syntax::source_map::{BytePos, Pos, Span};
 
-use source_map::LineRangeUtils;
 use comment::{rewrite_comment, CodeCharKind, CommentCodeSlices};
 use config::{EmitMode, FileName};
 use shape::{Indent, Shape};
+use source_map::LineRangeUtils;
 use utils::{count_newlines, last_line_width, mk_sp};
 use visitor::FmtVisitor;
 
@@ -315,7 +315,7 @@ fn process_missing_code(
                     self.push_str("\n");
                     status.last_wspace = None;
                 } else {
-                    self.push_str(&snippet[status.line_start..i + 1]);
+                    self.push_str(&snippet[status.line_start..=i]);
                 }
 
                 status.cur_line += 1;