From 5ecdd072d6745cd70ec7c37eea8dbf1f3ee42f2e Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Thu, 27 Oct 2016 02:40:08 -0500 Subject: [PATCH] Remove extra whitespace after macro calls --- src/missed_spans.rs | 7 +++++++ tests/source/issue-1192.rs | 3 +++ tests/target/issue-1192.rs | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 tests/source/issue-1192.rs create mode 100644 tests/target/issue-1192.rs diff --git a/src/missed_spans.rs b/src/missed_spans.rs index 98d87ba4963..b49686d40a6 100644 --- a/src/missed_spans.rs +++ b/src/missed_spans.rs @@ -178,6 +178,13 @@ fn replace_chars(string: &str) -> String { if last_wspace.is_none() { last_wspace = Some(i); } + } else if c == ';' { + if last_wspace.is_some() { + line_start = i; + } + + rewrite_next_comment = rewrite_next_comment || kind == CodeCharKind::Normal; + last_wspace = None; } else { rewrite_next_comment = rewrite_next_comment || kind == CodeCharKind::Normal; last_wspace = None; diff --git a/tests/source/issue-1192.rs b/tests/source/issue-1192.rs new file mode 100644 index 00000000000..4e39fbf9a36 --- /dev/null +++ b/tests/source/issue-1192.rs @@ -0,0 +1,3 @@ +fn main() { + assert!(true) ; +} diff --git a/tests/target/issue-1192.rs b/tests/target/issue-1192.rs new file mode 100644 index 00000000000..432fe8cce7c --- /dev/null +++ b/tests/target/issue-1192.rs @@ -0,0 +1,3 @@ +fn main() { + assert!(true); +}