Skip to content

Commit

Permalink
inline_fn_without_body: make it use a rustfix page
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Sep 21, 2019
1 parent ee9e1af commit 2fecf75
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
17 changes: 17 additions & 0 deletions tests/ui/inline_fn_without_body.fixed
Original file line number Diff line number Diff line change
@@ -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() {}
2 changes: 2 additions & 0 deletions tests/ui/inline_fn_without_body.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// run-rustfix

#![warn(clippy::inline_fn_without_body)]
#![allow(clippy::inline_always)]

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/inline_fn_without_body.stderr
Original file line number Diff line number Diff line change
@@ -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]
| _____-^^^^^^^^
Expand All @@ -9,15 +9,15 @@ 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)]
| _____-^^^^^^^^^^^^^^^^
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)]
| _____-^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 2fecf75

Please sign in to comment.