summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/missing_inline.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/missing_inline.rs')
-rw-r--r--src/tools/clippy/tests/ui/missing_inline.rs25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/tools/clippy/tests/ui/missing_inline.rs b/src/tools/clippy/tests/ui/missing_inline.rs
index 07f8e3888..dca85b94d 100644
--- a/src/tools/clippy/tests/ui/missing_inline.rs
+++ b/src/tools/clippy/tests/ui/missing_inline.rs
@@ -16,7 +16,10 @@ mod module {} // ok
pub mod pub_module {} // ok
fn foo() {}
-pub fn pub_foo() {} // missing #[inline]
+// missing #[inline]
+pub fn pub_foo() {}
+//~^ ERROR: missing `#[inline]` for a function
+//~| NOTE: `-D clippy::missing-inline-in-public-items` implied by `-D warnings`
#[inline]
pub fn pub_foo_inline() {} // ok
#[inline(always)]
@@ -32,7 +35,9 @@ trait Bar {
pub trait PubBar {
fn PubBar_a(); // ok
- fn PubBar_b() {} // missing #[inline]
+ // missing #[inline]
+ fn PubBar_b() {}
+ //~^ ERROR: missing `#[inline]` for a default trait method
#[inline]
fn PubBar_c() {} // ok
}
@@ -46,9 +51,15 @@ impl PubBar for Foo {
// all of these need inline because PubFoo is exported
impl PubBar for PubFoo {
- fn PubBar_a() {} // missing #[inline]
- fn PubBar_b() {} // missing #[inline]
- fn PubBar_c() {} // missing #[inline]
+ // missing #[inline]
+ fn PubBar_a() {}
+ //~^ ERROR: missing `#[inline]` for a method
+ // missing #[inline]
+ fn PubBar_b() {}
+ //~^ ERROR: missing `#[inline]` for a method
+ // missing #[inline]
+ fn PubBar_c() {}
+ //~^ ERROR: missing `#[inline]` for a method
}
// do not need inline because Foo is not exported
@@ -58,7 +69,9 @@ impl Foo {
// need inline because PubFoo is exported
impl PubFoo {
- pub fn PubFooImpl() {} // missing #[inline]
+ // missing #[inline]
+ pub fn PubFooImpl() {}
+ //~^ ERROR: missing `#[inline]` for a method
}
// do not lint this since users cannot control the external code