diff options
author | 2019-11-28 22:17:33 +0000 | |
---|---|---|
committer | 2019-11-28 22:17:33 +0000 | |
commit | ce538b28409ba15f42f1c0ff9b9e33d06f5e6dc8 (patch) | |
tree | 996de7759a2cd4fb8ff4170ce099d33886e2e8a6 /src/itm.rs | |
parent | 3607c6cfd5e7c1635064efbf37939420ea0b9d84 (diff) | |
parent | 3eebbfca17cde38d32fb3529f93ed61ae659ba1e (diff) | |
download | cortex-m-ce538b28409ba15f42f1c0ff9b9e33d06f5e6dc8.tar.gz cortex-m-ce538b28409ba15f42f1c0ff9b9e33d06f5e6dc8.tar.zst cortex-m-ce538b28409ba15f42f1c0ff9b9e33d06f5e6dc8.zip |
Merge #175
175: Enable the missing_inline_in_public_items clippy lint. r=jonas-schievink a=m-ou-se
This adds `#![deny(clippy::missing_inline_in_public_items)]` to make sure all functions in this crate are marked `#[inline]`, unless they are explicitly marked with `#[allow(clippy::missing_inline_in_public_items)]`.
Only three functions in this crate are not `#[inline]`:
- `write_words`
- `write_all`
- `write_aligned`
Additionally, the derived `Debug` impl's also have a non-inline implementations.
This unfortunately means that the allow attribute also needs to added to any types deriving `Debug`.
See also #171 and https://github.com/rust-embedded/cortex-m/pull/174#issuecomment-547304467.
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
Diffstat (limited to 'src/itm.rs')
-rw-r--r-- | src/itm.rs | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -9,6 +9,7 @@ use aligned::{Aligned, A4}; use crate::peripheral::itm::Stim; // NOTE assumes that `bytes` is 32-bit aligned +#[allow(clippy::missing_inline_in_public_items)] unsafe fn write_words(stim: &mut Stim, bytes: &[u32]) { let mut p = bytes.as_ptr(); for _ in 0..bytes.len() { @@ -30,6 +31,7 @@ impl<'p> fmt::Write for Port<'p> { /// Writes a `buffer` to the ITM `port` #[allow(clippy::cast_ptr_alignment)] +#[allow(clippy::missing_inline_in_public_items)] #[allow(clippy::transmute_ptr_to_ptr)] pub fn write_all(port: &mut Stim, buffer: &[u8]) { unsafe { @@ -90,6 +92,7 @@ pub fn write_all(port: &mut Stim, buffer: &[u8]) { /// itm::write_aligned(&itm.stim[0], &Aligned(*b"Hello, world!\n")); /// ``` #[allow(clippy::cast_ptr_alignment)] +#[allow(clippy::missing_inline_in_public_items)] #[allow(clippy::transmute_ptr_to_ptr)] pub fn write_aligned(port: &mut Stim, buffer: &Aligned<A4, [u8]>) { unsafe { |