mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
inline_fn_without_body: make it use a rustfix page
This commit is contained in:
parent
ee9e1af4ed
commit
2fecf756f7
17
tests/ui/inline_fn_without_body.fixed
Normal file
17
tests/ui/inline_fn_without_body.fixed
Normal 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() {}
|
@ -1,3 +1,5 @@
|
||||
// run-rustfix
|
||||
|
||||
#![warn(clippy::inline_fn_without_body)]
|
||||
#![allow(clippy::inline_always)]
|
||||
|
||||
|
@ -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)]
|
||||
| _____-^^^^^^^^^^^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user