1 #![feature(tool_lints)]
3 /* This file incorporates work covered by the following copyright and
5 * Copyright 2013 The Rust Project Developers. See the COPYRIGHT
6 * file at the top-level directory of this distribution and at
7 * http://rust-lang.org/COPYRIGHT.
9 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
10 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
11 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
12 * option. This file may not be copied, modified, or distributed
13 * except according to those terms.
15 #![warn(clippy::missing_inline_in_public_items)]
16 #![crate_type = "dylib"]
17 // When denying at the crate level, be sure to not get random warnings from the
18 // injected intrinsics by the compiler.
19 #![allow(dead_code, non_snake_case)]
21 type Typedef = String;
22 pub type PubTypedef = String;
25 pub struct PubFoo { } // ok
27 pub enum PubFooE {} // ok
30 pub mod pub_module {} // ok
33 pub fn pub_foo() {} // missing #[inline]
34 #[inline] pub fn pub_foo_inline() {} // ok
35 #[inline(always)] pub fn pub_foo_inline_always() {} // ok
37 #[allow(clippy::missing_inline_in_public_items)]
38 pub fn pub_foo_no_inline() {}
48 fn PubBar_b() {} // missing #[inline]
49 #[inline] fn PubBar_c() {} // ok
52 // none of these need inline because Foo is not exported
54 fn PubBar_a() {} // ok
55 fn PubBar_b() {} // ok
56 fn PubBar_c() {} // ok
59 // all of these need inline because PubFoo is exported
60 impl PubBar for PubFoo {
61 fn PubBar_a() {} // missing #[inline]
62 fn PubBar_b() {} // missing #[inline]
63 fn PubBar_c() {} // missing #[inline]
66 // do not need inline because Foo is not exported
71 // need inline because PubFoo is exported
73 pub fn PubFooImpl() {} // missing #[inline]