1 #![warn(clippy::missing_inline_in_public_items)]
2 #![crate_type = "dylib"]
3 // When denying at the crate level, be sure to not get random warnings from the
4 // injected intrinsics by the compiler.
5 #![allow(dead_code, non_snake_case)]
8 pub type PubTypedef = String;
11 pub struct PubFoo {} // ok
13 pub enum PubFooE {} // ok
16 pub mod pub_module {} // ok
19 pub fn pub_foo() {} // missing #[inline]
21 pub fn pub_foo_inline() {} // ok
23 pub fn pub_foo_inline_always() {} // ok
25 #[allow(clippy::missing_inline_in_public_items)]
26 pub fn pub_foo_no_inline() {}
35 fn PubBar_b() {} // missing #[inline]
37 fn PubBar_c() {} // ok
40 // none of these need inline because Foo is not exported
42 fn PubBar_a() {} // ok
43 fn PubBar_b() {} // ok
44 fn PubBar_c() {} // ok
47 // all of these need inline because PubFoo is exported
48 impl PubBar for PubFoo {
49 fn PubBar_a() {} // missing #[inline]
50 fn PubBar_b() {} // missing #[inline]
51 fn PubBar_c() {} // missing #[inline]
54 // do not need inline because Foo is not exported
59 // need inline because PubFoo is exported
61 pub fn PubFooImpl() {} // missing #[inline]
64 // do not lint this since users cannot control the external code