inline_fn_without_body: make it use a rustfix page

This commit is contained in:
Manish Goregaokar 2019-09-20 16:40:20 +09:00
parent ee9e1af4ed
commit 2fecf756f7
3 changed files with 22 additions and 3 deletions

View File

@ -0,0 +1,17 @@
// run-rustfix
#![warn(clippy::inline_fn_without_body)]
#![allow(clippy::inline_always)]
trait Foo {
fn default_inline();
fn always_inline();
fn never_inline();
#[inline]
fn has_body() {}
}
fn main() {}

View File

@ -1,3 +1,5 @@
// run-rustfix
#![warn(clippy::inline_fn_without_body)]
#![allow(clippy::inline_always)]

View File

@ -1,5 +1,5 @@
error: use of `#[inline]` on trait method `default_inline` which has no body
--> $DIR/inline_fn_without_body.rs:5:5
--> $DIR/inline_fn_without_body.rs:7:5
|
LL | #[inline]
| _____-^^^^^^^^
@ -9,7 +9,7 @@ LL | | fn default_inline();
= note: `-D clippy::inline-fn-without-body` implied by `-D warnings`
error: use of `#[inline]` on trait method `always_inline` which has no body
--> $DIR/inline_fn_without_body.rs:8:5
--> $DIR/inline_fn_without_body.rs:10:5
|
LL | #[inline(always)]
| _____-^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL | | fn always_inline();
| |____- help: remove
error: use of `#[inline]` on trait method `never_inline` which has no body
--> $DIR/inline_fn_without_body.rs:11:5
--> $DIR/inline_fn_without_body.rs:13:5
|
LL | #[inline(never)]
| _____-^^^^^^^^^^^^^^^