diff options
author | Casper <casperneo@uchicago.edu> | 2021-01-26 11:09:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 11:09:29 -0500 |
commit | 6effe431bbdef0580b6552a3246f7ec6b3751a2c (patch) | |
tree | fb76ae62042bd42e1d6f4bb86d4a04f4e4f11dfb /src/idl_gen_rust.cpp | |
parent | efcbdc7698987643ed713a9285f81863b4000f05 (diff) | |
download | flatbuffers-6effe431bbdef0580b6552a3246f7ec6b3751a2c.tar.gz flatbuffers-6effe431bbdef0580b6552a3246f7ec6b3751a2c.tar.bz2 flatbuffers-6effe431bbdef0580b6552a3246f7ec6b3751a2c.zip |
Rust: remove inner attributes (#6410)
* remove inner attributes
* Added test for outdir in Rust
* add bin/outdir
* Moved outdir test to its own package and only run it if flatc is available
Co-authored-by: Casper Neo <cneo@google.com>
Diffstat (limited to 'src/idl_gen_rust.cpp')
-rw-r--r-- | src/idl_gen_rust.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/idl_gen_rust.cpp b/src/idl_gen_rust.cpp index 1677ce82..424112c3 100644 --- a/src/idl_gen_rust.cpp +++ b/src/idl_gen_rust.cpp @@ -2497,7 +2497,9 @@ class RustGenerator : public BaseGenerator { } void GenNamespaceImports(const int white_spaces) { - if (white_spaces == 0) { code_ += "#![allow(unused_imports, dead_code)]"; } + // DO not use global attributes (i.e. #![...]) since it interferes + // with users who include! generated files. + // See: https://github.com/google/flatbuffers/issues/6261 std::string indent = std::string(white_spaces, ' '); code_ += ""; if (!parser_.opts.generate_all) { |