Skip to content
Snippets Groups Projects
Verified Commit af93866c authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add more clippy lints

parent 63e2a835
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,9 @@ rustup update "${RUSTUP_TOOLCHAIN}"
rustup component add clippy --toolchain "${RUSTUP_TOOLCHAIN}"
rustup component add rust-src --toolchain "${RUSTUP_TOOLCHAIN}"
# Cause recompilation
touch src/lib.rs
export RUST_TARGET_PATH="${PWD}/targets"
export RUSTFLAGS="-C soft-float -C debuginfo=2"
xargo clippy --lib --release --target x86_64-unknown-none
......@@ -19,10 +19,23 @@
#![allow(clippy::too_many_arguments)]
// There is no harm in this being done
#![allow(clippy::useless_format)]
// TODO: address ocurrances and then deny
#![warn(clippy::not_unsafe_ptr_arg_deref)]
// TODO: address ocurrances and then deny
#![warn(clippy::cast_ptr_alignment)]
// Indexing a slice can cause panics and that is something we always want to avoid
// in kernel code. Use .get and return an error instead
// TODO: address ocurrances and then deny
#![warn(clippy::indexing_slicing)]
// Overflows are very, very bad in kernel code as it may provide an attack vector for
// userspace applications, and it is only checked in debug builds
// TODO: address ocurrances and then deny
#![warn(clippy::integer_arithmetic)]
// Avoid panicking in the kernel without information about the panic. Use expect
// TODO: address ocurrances and then deny
#![warn(clippy::result_unwrap_used)]
// This is usually a serious issue - a missing import of a define where it is interpreted
// as a catch-all variable in a match, for example
#![deny(unreachable_patterns)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment