[Rust] Don't use inner attributes for allow (#5212)

* Don't use inner attributes for `allow`
Messes with being able to easily include elsewhere

* Regenerate tests

* No-op to retrigger CI

* Add the rest of the `allow` attributes
This commit is contained in:
bspeice
2019-03-09 14:58:27 -06:00
committed by Robert
parent 4f10da8d99
commit 3968d00568
10 changed files with 15 additions and 22 deletions

View File

@@ -1749,8 +1749,6 @@ class RustGenerator : public BaseGenerator {
void GenNamespaceImports(const int white_spaces) {
std::string indent = std::string(white_spaces, ' ');
code_ += indent + "#![allow(dead_code)]";
code_ += indent + "#![allow(unused_imports)]";
code_ += "";
code_ += indent + "use std::mem;";
code_ += indent + "use std::cmp::Ordering;";
@@ -1792,6 +1790,7 @@ class RustGenerator : public BaseGenerator {
// open namespace parts to reach the ns namespace
// in the previous example, E, then F, then G are opened
for (auto j = common_prefix_size; j != new_size; ++j) {
code_ += "#[allow(unused_imports, dead_code)]";
code_ += "pub mod " + MakeSnakeCase(ns->components[j]) + " {";
// Generate local namespace imports.
GenNamespaceImports(2);