Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
kernel
Commits
af93866c
Verified
Commit
af93866c
authored
5 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Add more clippy lints
parent
63e2a835
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clippy.sh
+3
-0
3 additions, 0 deletions
clippy.sh
src/lib.rs
+13
-0
13 additions, 0 deletions
src/lib.rs
with
16 additions
and
0 deletions
clippy.sh
+
3
−
0
View file @
af93866c
...
...
@@ -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
This diff is collapsed.
Click to expand it.
src/lib.rs
+
13
−
0
View file @
af93866c
...
...
@@ -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)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment