about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/inline_fn_without_body.fixed17
-rw-r--r--tests/ui/inline_fn_without_body.rs2
-rw-r--r--tests/ui/inline_fn_without_body.stderr6
3 files changed, 22 insertions, 3 deletions
diff --git a/tests/ui/inline_fn_without_body.fixed b/tests/ui/inline_fn_without_body.fixed
new file mode 100644
index 00000000000..fe21a71a42c
--- /dev/null
+++ b/tests/ui/inline_fn_without_body.fixed
@@ -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() {}
diff --git a/tests/ui/inline_fn_without_body.rs b/tests/ui/inline_fn_without_body.rs
index af81feaa374..50746989466 100644
--- a/tests/ui/inline_fn_without_body.rs
+++ b/tests/ui/inline_fn_without_body.rs
@@ -1,3 +1,5 @@
+// run-rustfix
+
 #![warn(clippy::inline_fn_without_body)]
 #![allow(clippy::inline_always)]
 
diff --git a/tests/ui/inline_fn_without_body.stderr b/tests/ui/inline_fn_without_body.stderr
index 87d2da71280..32d35e209b0 100644
--- a/tests/ui/inline_fn_without_body.stderr
+++ b/tests/ui/inline_fn_without_body.stderr
@@ -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)]
    |  _____-^^^^^^^^^^^^^^^