Skip to content

Commit 33f1415

Browse files
committed
inline_fn_without_body: make it use a rustfix page
1 parent 19dd671 commit 33f1415

3 files changed

+22
-3
lines changed

tests/ui/inline_fn_without_body.fixed

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// run-rustfix
2+
3+
#![warn(clippy::inline_fn_without_body)]
4+
#![allow(clippy::inline_always)]
5+
6+
trait Foo {
7+
fn default_inline();
8+
9+
fn always_inline();
10+
11+
fn never_inline();
12+
13+
#[inline]
14+
fn has_body() {}
15+
}
16+
17+
fn main() {}

tests/ui/inline_fn_without_body.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// run-rustfix
2+
13
#![warn(clippy::inline_fn_without_body)]
24
#![allow(clippy::inline_always)]
35

tests/ui/inline_fn_without_body.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: use of `#[inline]` on trait method `default_inline` which has no body
2-
--> $DIR/inline_fn_without_body.rs:5:5
2+
--> $DIR/inline_fn_without_body.rs:7:5
33
|
44
LL | #[inline]
55
| _____-^^^^^^^^
@@ -9,15 +9,15 @@ LL | | fn default_inline();
99
= note: `-D clippy::inline-fn-without-body` implied by `-D warnings`
1010

1111
error: use of `#[inline]` on trait method `always_inline` which has no body
12-
--> $DIR/inline_fn_without_body.rs:8:5
12+
--> $DIR/inline_fn_without_body.rs:10:5
1313
|
1414
LL | #[inline(always)]
1515
| _____-^^^^^^^^^^^^^^^^
1616
LL | | fn always_inline();
1717
| |____- help: remove
1818

1919
error: use of `#[inline]` on trait method `never_inline` which has no body
20-
--> $DIR/inline_fn_without_body.rs:11:5
20+
--> $DIR/inline_fn_without_body.rs:13:5
2121
|
2222
LL | #[inline(never)]
2323
| _____-^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)