Skip to content

Commit 3eebbfc

Browse files
committed
Add explanation about clippy::missing_inline_in_public_items lint.
1 parent b5c2463 commit 3eebbfc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@
3434
#![no_std]
3535
#![allow(clippy::identity_op)]
3636
#![allow(clippy::missing_safety_doc)]
37+
38+
// This makes clippy warn about public functions which are not #[inline].
39+
//
40+
// Almost all functions in this crate result in trivial or even no assembly.
41+
// These functions should be #[inline].
42+
//
43+
// If you do add a function that's not supposed to be #[inline], you can add
44+
// #[allow(clippy::missing_inline_in_public_items)] in front of it to add an
45+
// exception to clippy's rules.
46+
//
47+
// This should be done in case of:
48+
// - A function containing non-trivial logic (such as itm::write_all); or
49+
// - A generated #[derive(Debug)] function (in which case the attribute needs
50+
// to be applied to the struct).
3751
#![deny(clippy::missing_inline_in_public_items)]
3852

3953
extern crate aligned;

0 commit comments

Comments
 (0)