-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Using #[inline] on function prototype should emit a warning #51280
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
Comments
Your trait method is a default method - are inline hints actually ignored there, too (that sounds like a bug)? Perhaps you meant to declare it without a body. |
Yes, meant to declare without a body. Example fixed. |
If anyone's interested in pushing for this by default, it can already be found in clippy. https://rust-lang-nursery.github.io/rust-clippy/master/index.html#inline_fn_without_body |
…thewjasper Lint ignored `#[inline]` on function prototypes Fixes rust-lang#51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
…thewjasper Lint ignored `#[inline]` on function prototypes Fixes rust-lang#51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
The following trait does not emit any warnings, although it should warn that the
#[inline]
hint is ignored on function prototypes.Likewise for extern functions. E.g. should warn on
The text was updated successfully, but these errors were encountered: