From: Gaƫtan Cassiers Date: Mon, 24 Aug 2015 20:01:01 +0000 (+0200) Subject: Fix #190 for submodules X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=76ea7e3b643a85aee4bec55a3a840edb5295819d;p=rust.git Fix #190 for submodules --- diff --git a/src/missed_spans.rs b/src/missed_spans.rs index aa1d4679e9a..33d096c3ba0 100644 --- a/src/missed_spans.rs +++ b/src/missed_spans.rs @@ -44,7 +44,7 @@ fn format_missing_inner(&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, "", ""); diff --git a/tests/source/mod-2.rs b/tests/source/mod-2.rs index 75b560ce93f..c4a148a616e 100644 --- a/tests/source/mod-2.rs +++ b/tests/source/mod-2.rs @@ -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 index 00000000000..f79c691f085 --- /dev/null +++ b/tests/source/no_new_line_beginning.rs @@ -0,0 +1,2 @@ +fn main() { +} diff --git a/tests/target/mod-2.rs b/tests/target/mod-2.rs index 75b560ce93f..c4a148a616e 100644 --- a/tests/target/mod-2.rs +++ b/tests/target/mod-2.rs @@ -1,3 +1,4 @@ // Some nested mods mod nestedmod; +mod no_new_line_beginning;