aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Mara Bos <m-ou.se@m-ou.se> 2019-11-26 14:37:12 +0100
committerGravatar Mara Bos <m-ou.se@m-ou.se> 2019-11-26 14:37:12 +0100
commit3eebbfca17cde38d32fb3529f93ed61ae659ba1e (patch)
tree996de7759a2cd4fb8ff4170ce099d33886e2e8a6 /src/lib.rs
parentb5c24630bdf5a23008885c4771a2d31060f8c180 (diff)
downloadcortex-m-3eebbfca17cde38d32fb3529f93ed61ae659ba1e.tar.gz
cortex-m-3eebbfca17cde38d32fb3529f93ed61ae659ba1e.tar.zst
cortex-m-3eebbfca17cde38d32fb3529f93ed61ae659ba1e.zip
Add explanation about clippy::missing_inline_in_public_items lint.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9cfc776..481d84e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -34,6 +34,20 @@
#![no_std]
#![allow(clippy::identity_op)]
#![allow(clippy::missing_safety_doc)]
+
+// This makes clippy warn about public functions which are not #[inline].
+//
+// Almost all functions in this crate result in trivial or even no assembly.
+// These functions should be #[inline].
+//
+// If you do add a function that's not supposed to be #[inline], you can add
+// #[allow(clippy::missing_inline_in_public_items)] in front of it to add an
+// exception to clippy's rules.
+//
+// This should be done in case of:
+// - A function containing non-trivial logic (such as itm::write_all); or
+// - A generated #[derive(Debug)] function (in which case the attribute needs
+// to be applied to the struct).
#![deny(clippy::missing_inline_in_public_items)]
extern crate aligned;