-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Using #[inline] on function prototype should emit a warning #51280
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
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 |
scottmcm
added
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
labels
Jul 31, 2018
Centril
added a commit
to Centril/rust
that referenced
this issue
Oct 29, 2019
…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).
Centril
added a commit
to Centril/rust
that referenced
this issue
Oct 29, 2019
…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).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
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: