Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the missing_inline_in_public_items clippy lint. #175

Merged
merged 2 commits into from
Nov 28, 2019

Conversation

m-ou-se
Copy link
Contributor

@m-ou-se m-ou-se commented Oct 29, 2019

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 #174 (comment).

@m-ou-se m-ou-se requested a review from a team as a code owner October 29, 2019 14:51
@rust-highfive
Copy link

r? @thejpster

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m labels Oct 29, 2019
@thejpster
Copy link
Contributor

Could we add a comment that explains under which circumstances it's appropriate to use the #[allow(clippy::missing_inline_in_public_items)] lint?

@m-ou-se
Copy link
Contributor Author

m-ou-se commented Nov 26, 2019

Could we add a comment that explains under which circumstances it's appropriate to use the #[allow(clippy::missing_inline_in_public_items)] lint?

Done!

@jonas-schievink
Copy link
Contributor

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.

This sounds like a bug in the lint – it's not really appropriate to warn about code the user doesn't control. I filed rust-lang/rust-clippy#4861 to track this.

Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me, thanks!

We should probably file an issue about the #[derive(Debug)] issue so we don't forget to remove all those #[allow]s once rust-lang/rust-clippy#4861 is fixed.

@therealprof
Copy link
Contributor

bors r=jonas-schievink

bors bot added a commit that referenced this pull request Nov 28, 2019
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 #174 (comment).

Co-authored-by: Mara Bos <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 28, 2019

Build succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants