diff options
author | David Tolnay <dtolnay@chromium.org> | 2019-04-15 09:36:51 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-17 17:23:11 -0700 |
commit | b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9 (patch) | |
tree | 818986513938e87ae83573e8e0e378325209303b /protos | |
parent | 8c35fc361b209e204417c0ec8f65749016035c6e (diff) | |
download | crosvm-b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9.tar crosvm-b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9.tar.gz crosvm-b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9.tar.bz2 crosvm-b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9.tar.lz crosvm-b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9.tar.xz crosvm-b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9.tar.zst crosvm-b1de6323ab8c96c52a60e0ff735e4bbb8a8464c9.zip |
clippy: Suppress warning from protoc_rust generated code
Protoc_rust emits this into every file it generates: #![cfg_attr(feature = "cargo-clippy", allow(clippy))] which is the old style of tool attribute. It is deprecated in favor of actual tool attributes that stabilized in rust 1.31. #![allow(clippy::all)] Without this PR, the warning when running bin/clippy looks like: warning: lint name `clippy` is deprecated and may not have an effect in the future. --> /chromiumos/src/platform/crosvm/target/debug/build/protos/out/trunks/interface.rs:6:10 | 6 | #![cfg_attr(feature = "cargo-clippy", allow(clippy))] | ^^^^^^ | = note: #[warn(renamed_and_removed_lints)] on by default TEST=bin/clippy Change-Id: I1a484379a8f53d76d3667590cd8458588492d2b1 Reviewed-on: https://chromium-review.googlesource.com/1567849 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'protos')
-rw-r--r-- | protos/build.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/protos/build.rs b/protos/build.rs index fa839ca..b510e54 100644 --- a/protos/build.rs +++ b/protos/build.rs @@ -98,8 +98,14 @@ fn protoc<P: AsRef<Path>>(module: &str, input_path: P, mut out: &File) -> Result })?; // Write out a `mod` that refers to the generated module. + // + // The lint suppression is because protoc-rust emits + // #![cfg_attr(feature = "cargo-clippy", allow(clippy))] + // which still works but is deprecated in favor of tool attributes: + // #![allow(clippy::all)]. let file_stem = input_path.file_stem().unwrap().to_str().unwrap(); writeln!(out, "#[path = \"{}/{}.rs\"]", out_dir, file_stem)?; + writeln!(out, "#[allow(renamed_and_removed_lints)]")?; writeln!(out, "pub mod {};", module)?; Ok(()) |