]> git.lizzy.rs Git - rust.git/commitdiff
Fix #190 for submodules
authorGaëtan Cassiers <gaetan.cassiers@gmail.com>
Mon, 24 Aug 2015 20:01:01 +0000 (22:01 +0200)
committerGaëtan Cassiers <gaetan.cassiers@gmail.com>
Mon, 24 Aug 2015 20:01:01 +0000 (22:01 +0200)
src/missed_spans.rs
tests/source/mod-2.rs
tests/source/no_new_line_beginning.rs [new file with mode: 0644]
tests/target/mod-2.rs

index aa1d4679e9a8b25fbc67a744d5e417fc311a238b..33d096c3ba0802c356f30f9c0d97e10d40fbb3c9 100644 (file)
@@ -44,7 +44,7 @@ fn format_missing_inner<F: Fn(&mut FmtVisitor, &str, &str)>(&mut self,
 
         if start == end {
             // Do nothing if this is the beginning of the file.
-            if start == BytePos(0) {
+            if start == self.codemap.lookup_char_pos(start).file.start_pos {
                 return;
             }
             process_last_snippet(self, "", "");
index 75b560ce93f9e7378c779cc62d251b54a7e96b48..c4a148a616ec98c74fd5170c9851a5a71f48ab91 100644 (file)
@@ -1,3 +1,4 @@
 // Some nested mods
 
 mod nestedmod;
+mod no_new_line_beginning;
diff --git a/tests/source/no_new_line_beginning.rs b/tests/source/no_new_line_beginning.rs
new file mode 100644 (file)
index 0000000..f79c691
--- /dev/null
@@ -0,0 +1,2 @@
+fn main() {
+}
index 75b560ce93f9e7378c779cc62d251b54a7e96b48..c4a148a616ec98c74fd5170c9851a5a71f48ab91 100644 (file)
@@ -1,3 +1,4 @@
 // Some nested mods
 
 mod nestedmod;
+mod no_new_line_beginning;