瀏覽代碼

Configure rustc and clippy warnings.

Bruce Mitchener 7 年之前
父節點
當前提交
97e185c336
共有 7 個文件被更改,包括 11 次插入1 次删除
  1. 1 0
      clippy.toml
  2. 1 0
      examples/load_elf.rs
  3. 3 1
      src/lib.rs
  4. 1 0
      tests/assembler.rs
  5. 3 0
      tests/misc.rs
  6. 1 0
      tests/ubpf_jit_x86_64.rs
  7. 1 0
      tests/ubpf_vm.rs

+ 1 - 0
clippy.toml

@@ -0,0 +1 @@
+doc-valid-idents = ["eBPF", "uBPF"] 

+ 1 - 0
examples/load_elf.rs

@@ -4,6 +4,7 @@
 // the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
 // copied, modified, or distributed except according to those terms.
 
+#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
 
 extern crate elf;
 use std::path::PathBuf;

+ 3 - 1
src/lib.rs

@@ -14,8 +14,10 @@
        html_favicon_url = "https://raw.githubusercontent.com/qmonnet/rbpf/master/misc/rbpf.ico")]
 
 #![warn(missing_docs)]
+// There are unused mut warnings due to unsafe code.
+#![allow(unused_mut)]
 
-#![cfg_attr(feature = "cargo-clippy", allow(doc_markdown, match_same_arms))]
+#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless, doc_markdown, match_same_arms, unreadable_literal))]
 
 use std::u32;
 use std::collections::HashMap;

+ 1 - 0
tests/assembler.rs

@@ -4,6 +4,7 @@
 // the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
 // copied, modified, or distributed except according to those terms.
 
+#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
 
 extern crate rbpf;
 mod common;

+ 3 - 0
tests/misc.rs

@@ -4,6 +4,9 @@
 // the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
 // copied, modified, or distributed except according to those terms.
 
+// There are unused mut warnings due to unsafe code.
+#![allow(unused_mut)]
+#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
 
 // These crates would be needed to load bytecode from a BPF-compiled object file. Since the crates
 // are not used anywhere else in the library, it is deactivated: we do not want to load and compile

+ 1 - 0
tests/ubpf_jit_x86_64.rs

@@ -20,6 +20,7 @@
 
 // These are unit tests for the eBPF JIT compiler.
 
+#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
 
 extern crate rbpf;
 mod common;

+ 1 - 0
tests/ubpf_vm.rs

@@ -20,6 +20,7 @@
 
 // These are unit tests for the eBPF interpreter.
 
+#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
 
 extern crate rbpf;
 mod common;