blob: a3b6be6725bb014045e816356506962794849a2f [file] [log] [blame]
Ivan Lozanob32d5e82020-08-26 15:19:37 -04001From 38f7b959fdedb839ce412b7e3faa067d315fc13a Mon Sep 17 00:00:00 2001
2From: Ivan Lozano <ivanlozano@google.com>
3Date: Wed, 26 Aug 2020 15:19:37 -0400
4Subject: [PATCH] Allow generated source to be root module src.
5
6rustfmt::skip breaks compilation when used as a root module source. We
7don't run rustfmt on generated source anyhow.
8See https://github.com/stepancheg/rust-protobuf/issues/493#issuecomment-652874447
9
10Bug: 143953733
11Test: rust_protobuf can generate library variants.
12Change-Id: I0ea47de25c0ddd65781d6509b09ea648d11c4277
13---
14 src/code_writer.rs | 3 ++-
15 1 file changed, 2 insertions(+), 1 deletion(-)
16
17diff --git a/src/code_writer.rs b/src/code_writer.rs
18index 8b53bc6..855b785 100644
19--- a/src/code_writer.rs
20+++ b/src/code_writer.rs
21@@ -58,7 +58,8 @@ impl<'a> CodeWriter<'a> {
22 self.write_line("#![allow(clippy::all)]");
23 self.write_line("");
24 self.write_line("#![allow(unused_attributes)]");
25- self.write_line("#![rustfmt::skip]");
26+ // ANDROID CHANGE: comment out rustfmt::skip to fix compilation error.
27+ //self.write_line("#![rustfmt::skip]");
28 self.write_line("");
29 self.write_line("#![allow(box_pointers)]");
30 self.write_line("#![allow(dead_code)]");
31--
322.28.0.297.g1956fa8f8d-goog
33