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.
10 /* This file incorporates work covered by the following copyright and
12 * Copyright 2013 The Rust Project Developers. See the COPYRIGHT
13 * file at the top-level directory of this distribution and at
14 * http://rust-lang.org/COPYRIGHT.
16 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
17 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
18 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
19 * option. This file may not be copied, modified, or distributed
20 * except according to those terms.
22 #![warn(clippy::missing_inline_in_public_items)]
23 #![crate_type = "dylib"]
24 // When denying at the crate level, be sure to not get random warnings from the
25 // injected intrinsics by the compiler.
26 #![allow(dead_code, non_snake_case)]
28 type Typedef = String;
29 pub type PubTypedef = String;
32 pub struct PubFoo {} // ok
34 pub enum PubFooE {} // ok
37 pub mod pub_module {} // ok
40 pub fn pub_foo() {} // missing #[inline]
42 pub fn pub_foo_inline() {} // ok
44 pub fn pub_foo_inline_always() {} // ok
46 #[allow(clippy::missing_inline_in_public_items)]
47 pub fn pub_foo_no_inline() {}
56 fn PubBar_b() {} // missing #[inline]
58 fn PubBar_c() {} // ok
61 // none of these need inline because Foo is not exported
63 fn PubBar_a() {} // ok
64 fn PubBar_b() {} // ok
65 fn PubBar_c() {} // ok
68 // all of these need inline because PubFoo is exported
69 impl PubBar for PubFoo {
70 fn PubBar_a() {} // missing #[inline]
71 fn PubBar_b() {} // missing #[inline]
72 fn PubBar_c() {} // missing #[inline]
75 // do not need inline because Foo is not exported
80 // need inline because PubFoo is exported
82 pub fn PubFooImpl() {} // missing #[inline]