1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
13 /* This file incorporates work covered by the following copyright and
15 * Copyright 2013 The Rust Project Developers. See the COPYRIGHT
16 * file at the top-level directory of this distribution and at
17 * http://rust-lang.org/COPYRIGHT.
19 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
20 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
21 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
22 * option. This file may not be copied, modified, or distributed
23 * except according to those terms.
25 #![warn(clippy::missing_inline_in_public_items)]
26 #![crate_type = "dylib"]
27 // When denying at the crate level, be sure to not get random warnings from the
28 // injected intrinsics by the compiler.
29 #![allow(dead_code, non_snake_case)]
31 type Typedef = String;
32 pub type PubTypedef = String;
35 pub struct PubFoo { } // ok
37 pub enum PubFooE {} // ok
40 pub mod pub_module {} // ok
43 pub fn pub_foo() {} // missing #[inline]
44 #[inline] pub fn pub_foo_inline() {} // ok
45 #[inline(always)] pub fn pub_foo_inline_always() {} // ok
47 #[allow(clippy::missing_inline_in_public_items)]
48 pub fn pub_foo_no_inline() {}
58 fn PubBar_b() {} // missing #[inline]
59 #[inline] fn PubBar_c() {} // ok
62 // none of these need inline because Foo is not exported
64 fn PubBar_a() {} // ok
65 fn PubBar_b() {} // ok
66 fn PubBar_c() {} // ok
69 // all of these need inline because PubFoo is exported
70 impl PubBar for PubFoo {
71 fn PubBar_a() {} // missing #[inline]
72 fn PubBar_b() {} // missing #[inline]
73 fn PubBar_c() {} // missing #[inline]
76 // do not need inline because Foo is not exported
81 // need inline because PubFoo is exported
83 pub fn PubFooImpl() {} // missing #[inline]