diff --git a/src/visitor.rs b/src/visitor.rs index 58a94b12dfd..c9126b69f63 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -622,7 +622,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> { self.push_str(s); } else { let snippet = self.snippet(span); - self.push_str(snippet); + self.push_str(snippet.trim()); } self.last_pos = source!(self, span).hi(); } diff --git a/tests/target/issue-3741.rs b/tests/target/issue-3741.rs new file mode 100644 index 00000000000..34d22dc91eb --- /dev/null +++ b/tests/target/issue-3741.rs @@ -0,0 +1,5 @@ +pub enum PublishedFileVisibility { + Public = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPublic as i32, + FriendsOnly = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityFriendsOnly as i32, + Private = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPrivate as i32, +}